benchmark-ips icon indicating copy to clipboard operation
benchmark-ips copied to clipboard

Don't print error when printing standard deviation in comparison

Open ivoanjo opened this issue 3 years ago • 3 comments

Hello there! Thanks a lot for benchmark-ips :)

Today I was using it for a few tests and noticed that whenever the percentage of standard deviation shows up in the comparison, it's always zero. E.g. with the example on the README.md I get:

Warming up --------------------------------------
            addition     2.390M i/100ms
           addition2     5.597M i/100ms
           addition3     5.260M i/100ms
addition-test-long-label
                         2.377M i/100ms
Calculating -------------------------------------
            addition     23.737M (± 3.0%) i/s -    119.519M in   5.040228s
           addition2     54.560M (± 3.0%) i/s -    274.271M in   5.031700s
           addition3     52.988M (± 1.8%) i/s -    268.258M in   5.064310s
addition-test-long-label
                         24.121M (± 1.3%) i/s -    121.248M in   5.027489s

Comparison:
           addition2: 54560399.9 i/s
           addition3: 52988283.5 i/s - same-ish: difference falls within error
addition-test-long-label: 24121165.9 i/s - 2.26x  (± 0.00) slower <-- zero?
            addition: 23736650.2 i/s - 2.30x  (± 0.00) slower <--- zero?

Every benchmark I also ran today always showed the (± 0.00) in the comparison. Is this expected?

I'm using benchmark-ips version 2.8.4, using different Ruby versions, on macOS.

ivoanjo avatar Feb 10 '21 15:02 ivoanjo

We don't calculate error for standard deviation, so this is expected.

Maybe we shouldn't bother printing it, though.

nateberkopec avatar Feb 10 '21 22:02 nateberkopec

I think it would be useful to still have the error for the values itself on the comparison, but yeah that's more of a separate feature, so yeah hiding the (± 0.00) sounds like the way to go here :)

ivoanjo avatar Feb 11 '21 11:02 ivoanjo

I think that is saying that this is basically close enough.

kbrock avatar Feb 18 '21 23:02 kbrock

as of release 2.11.0, standard deviation mode returns nil instead of zero for the error. (see #124)

jtbg avatar Mar 30 '23 06:03 jtbg