Hacker News new | ask | show | jobs
by kevingadd 1698 days ago
If your goal is to benchmark something like to_int64, you should be benchmarking it on a wide range of values instead of just ones and one-halves. You can always pre-generate a diverse data set and shove it in memory - how expensive that is doesn't matter, since all your benchmarks will be paying the same cost to read the test data (unless one of your benchmark test cases is so profoundly slow that it pushes the test data out of cache)

Similarly you definitely should have a table of known numbers you want to test and not just go through the space by 0.5. You want to test denormals, stuff like 1/3, etc.