Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You should always be comparing best case for this kind of thing. Slower cases are most likely "your thread got switched out by the OS to let something else run", and that's not really a fair test.


If you want to guard against context switches by the OS, don't use stuff that "most likely" works. Measure with perf and let it count the context switches.


Which is why you use 90th percentile.


What's wrong with using the best result? If you're concerned the code could run faster than possible: don't be :)


What if the test data is random? Could just get lucky and get a happy day scenario.


Then both versions should get that "happy day"? If you are using distinct random data for each version, then you aren't really benchmarking properly.


It doesn't say that they both use the same data sets.


If they are using different data sets, then I'd say it's an invalid benchmark.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: