ionelmc / pytest-benchmark

py.test fixture for benchmarking code
BSD 2-Clause "Simplified" License
1.22k stars 115 forks source link

Histogram title customization #216

Open adeak opened 2 years ago

adeak commented 2 years ago

I noticed that the histogram title always looks something like this:

example histogram from the docs

Speaking of pedantic, I find "speed" with units of time surprising :) Beyond pedantry I would expect "larger speed" meaning faster, while "larger time interval" meaning slower.

Looking at the implementation the "Speed in" prefix seems hard-coded:

https://github.com/ionelmc/pytest-benchmark/blob/c0d0104d385a09acc9246e6ee2a6d42fae937c2d/src/pytest_benchmark/histogram.py#L100-L106

Would it be possible to allow some customization of the prefix? I would like to change it to something like "Runtime in {0}".