algebra icon indicating copy to clipboard operation
algebra copied to clipboard

Consider switching from Criterion to cargo bench

Open jon-chuang opened this issue 4 years ago • 5 comments

Criterion sucks - it takes way too long to bench. I'm sure I've raised this issue before. It's very difficult to make settings that get around the whole annoying "statistical significance" mumbo jumbo it uses.

Google's Go bench framework is much better. I think I will finally get fed up enough that I'll rework all the benchmarks.

jon-chuang avatar Mar 25 '21 06:03 jon-chuang

The statistical significance measurements are very important for micro-benches though. Agreed that they don't give that much at the larger benchmark sizes, and just cause delays

ValarDragon avatar Mar 25 '21 15:03 ValarDragon

One nice feature of criterion is that it's stateful: it automatically compares the differences between two benchmarks. With benchcmp I have to do that manually.

Pratyush avatar Mar 25 '21 16:03 Pratyush

@Pratyush I think this is a feature rather than a problem. Comparing manually just requires piping to a file. But criterion only allows for comparing two benchmarks. What if I want to compare 3 benchmarks, or a benchmark I had already run in the past? You can't do this with criterion.

jon-chuang avatar Apr 18 '21 04:04 jon-chuang

I have run into that problem as well, I'm not sure I'd classify the statefulness as a feature, since it does become a pain to track which change was benched last in order to get accurate timing measurements

ValarDragon avatar Apr 20 '21 03:04 ValarDragon

The statefulness is actually a pain. Typically, what you want to do is mark a particular revision and then compare the current state to that revision as you make changes. Criterion can't do that (AFAIK), which makes its comparison feature a bit of an "attractive nuisance" if you ask me. And yes, Criterion benchmarking does take ridiculously long (I know you can tweak iteration counts manually, but meh).

daira avatar Apr 20 '21 07:04 daira