探索引入泛型对 lfring 产生的性能影响
本文是对我自己的一个库 go-lock-free-ring-buffer (简称 lfring)改造泛型而产生性能影响的讨论。
介绍该 lfring 的文章可见这里。
本文介绍了一种将 inception 分析部分拆细,已迭代的形式掺入落地阶段的一种办法。
作为一名程序员,总有一些时候,会对自己所做的重复性的工作感到厌倦,也会羡慕明星项目做得热火朝天 star 数蹭蹭上涨。而读代码,则是缓解焦虑的良方。
每当读懂软件的精彩设计,赞叹优美整洁的代码,甚至发现藏在注释中的彩蛋时,都好像在不同的时空与作者产生了交叉,畅快地聊了会儿天。
读代码很有趣,但要读通读懂也很费功夫。本文是我在日常读代码中积累的一点心得,分享出来,希望能与大家产生共鸣。
本文介绍了 Golang Runtime 中关于内存管理的设计。
本文介绍了 Golang Runtime 中关于 goroutine 以及调度器的设计。
本文纯代码 + 注释,不适合人类阅读。Go Version = 1.17.6
It seems like time elapse way faster than my memory and mind. It's already 2022!
If use some phrases to summaries my 2021, I think I'll take leisure, self promotion and anxiety.
I spend such a good leisure time almost whole year. Due to lack of project in my department, I'm stay on the beach about 8 weeks totally. Even most of my 15 days annual vacations were took in that beach time, to lower my cost. Hence, I have a plenty of spare time to do what I love to, include coding, speak sessions, learning and traveling!
It's no big deal for my "self promotion" part. The key words maybe contains read some books, dabble some techs, open source some code, write some articles, get real "promotion"(only title but maybe not pay) and try some new job contents.
I think it's quite common to say I'm anxious about my life while 2021 it's my first year over 30-year-old. The more deep dive to software development field, I can feel more regret to go into this industry in my 25 rather than 18! If I choose CS in my collage, I'm sure I can do better than today's me. I spent 7 years at my EE major, I feel good about it, but I don't love it. After graduation I meet many excellent people, they're good at coding, have passion in software technology, and love to share. But the most important thing is they're all so young and still have a lot of years to explore and improve.
面向开发者的软件,相比普通用户仅在限定的场景下使用外,还可能会被集成、扩展、二次开发等等,因此在代码或设计层面也应该尽可能考虑如何对开发者更友好。
本文从:
三个不同的角度,结合实际案例,尝试阐述和讨论哪些设计是对开发者友好的。
本文是对 raft paper 的翻译,原文请见 https://raft.github.io/raft.pdf
Raft 是一种用于管理 log 复制的共识算法。它采用了与 Paxos 不同的算法结构,但能产出与 (multi-)Paxos 等价的结果,并且与 Paxos 一样高效;这令 Raft 成为了比 Paxos 更易于理解且能为构建实际系统提供更好的基础的一种算法。为了更加易懂,Raft 将共识算法中的几个关键元素(比如 leader 选举,log 复制,安全等)互相分离,并通过使用更强的一致性要求来减少必须要考虑的状态(state)的数量。用户调研的结果显示 Raft 相比 Paxos 而言更容易学习。同时,Raft 还包含了一种新的通过覆盖大多数来确保安全的机制来修改集群成员。
B+ Tree 与 LSM Tree 是现今各类数据库中使用的比较多的两种数据结构,它们都可以作为数据库的文件组织形式,用于以相对高效的形式来执行数据库的读写。
本文简述了这两种数据结构的操作方式与操作开销,并对比了其自身的优缺点。