Closed mewmew closed 9 years ago
It's intended, for better or worse. The rationale is that this way you can rely on the fact that the first digit in the old column and the first digit in the new column have the same meaning. If there was a unit change or even motion of the decimal point it could be easily missed and you might be comparing numbers that are not actually directly comparable. It does mean that if you make something 1000x faster, the new speed prints as 0.00 in the new column, but that's something I'm willing to live with. :-)
In this case the thing to do is probably to follow that command by a plain 'benchstat new.txt' to show the new data (alone) in more natural units.
I agree with the rationale as the trade-off seems worth it. If the decimal point moved or the unit changed, the output might be misread. And the drawback may be mitigated, as you already mentioned, by invoking benchstat FILE
in the rare cases when the mean is truncated to 0.00.
Thanks for a great tool Russ! For the longest of time, my friend Daniel and I were convinced that you were an AI cluster at Google rather than a single human being. This was the only reasonable explanation we could conjure which would account for all the work produced under the alias rsc. Our favorite moment was when Brad Fitzpatrick proposed read-only slices on golang-dev, which received initial discussions regarding syntax, intermediate discussions regarding potential benefit (merging the bytes
and strings
packages into a single package, ...), and final discussions regarding your forked implementation of Go which implemented the proposal to thoroughly review its implications. Whomever you are, we admire your efforts rsc.
When the benchmark delta end up changing the unit of the new mean, the value is still presented using the same unit as the old mean. This may be intended behaviour, but if that is not the case I've included a benchmark example which demonstrates this behaviour.
Example:
Notice the new mean 0.00ms of
EncGlobalNameReplace
andEncLocalNameReplace
. The same value could be represented as 1.46µs.