←back to thread

386 points ingve | 1 comments | | HN request time: 0.201s | source
Show context
abainbridge ◴[] No.35739367[source]
How does the benchmarking work here? I always find this kind of micro-benchmarking hard. I feel like I want to see results with and without a preceding cache flush. And with/without clearing of the branch predictor state. Other things I find hard are: 1) ensuring that the CPU is running at full(ish) speed and isn't in a slower-clocked power saving mode for some of the test, 2) effects of code and data alignment can be significant - I want to measure a bunch of different alignments.

Does gtest (that the author used) help with these things? Does anything?

replies(2): >>35739444 #>>35743578 #
1. kccqzy ◴[] No.35743578[source]
According to Intel, for accurate benchmarking you should write a Linux kernel module. And remember to disable preemption and disable interrupts.

https://www.intel.com/content/dam/www/public/us/en/documents...