Hacker News new | ask | show | jobs
by aardvark179 542 days ago
Excellent advice. It’s also very important to know what any micro benchmarks you do have are really measuring. I’ve seen enough that actually measured the time to setup or parse something because they dominated and wasn’t cached correctly. Conversely I’ve seen cases where the JIT correctly optimised away almost everything because there was a check on the final value.

Oh, and if each op takes under a nanosecond than your benchmark is almost certainly completely broken.