Posted in

为什么Benchmark结果骗了你?:Golang slice去重真实耗时拆解(CPU cache line / false sharing / branch prediction)

第一章:Golang slice … 为什么Benchmark结果骗了你?:Golang slice去重真实耗时拆解(CPU cache line / false sharing / branch prediction)Read more

Posted in

Go切片的CPU分支预测失败率高达63%?通过预填充hint slice实现条件切片分支消除(实测提升吞吐31.2%)

第一章:Go切片的CPU分支预测 … Go切片的CPU分支预测失败率高达63%?通过预填充hint slice实现条件切片分支消除(实测提升吞吐31.2%)Read more

Posted in

Go位运算认知误区大扫除:你以为的“x & 1 == 1”判断奇偶,其实已触发分支预测失败!

第一章:Go位运算的核心价值与底 … Go位运算认知误区大扫除:你以为的“x & 1 == 1”判断奇偶,其实已触发分支预测失败!Read more