Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch performance tests from BenchmarkTools to Chairmarks to reduce runtime from 13 minutes to 30 seconds. #23

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

LilithHafner
Copy link
Contributor

Both BenchmarkTools and Chairmarks are adequately reproducible and precise. Switching from BenchmarkTools to Chairmarks does not change reported runtime rations by much.

BenchmarkTools (master) reproducibility

I ran the existing benchmark suite twice and for each measured ratio plotted a point with the x position equal to the ratio measured on the first trial and the y position equal to the ratio on the second trial. This is a plot of results from one trial vs results from a second trail. If the benchmarks were perfectly reproducible, all points would lie on the line y=x which is plotted as well.

bm-x, bm-y

We can see that there is a pretty good reproducibility between trials. That's good.

Chairmarks (pr) reproducibility

Same as above but using this PR's benchmarks which use Chairmarks instead of BenchmarkTools

cm-x, cm-y

There is still a pretty good reproducibility between trials. That's good.

Absolute difference

When we plot the ratios reported by Chairmarks on the x axis and those reported by BenchmarkTools on the y axis, we can see a slightly lower cross-methodology correlation:

cm-x, bm-y

For cases where BenchmarkTools currently reports that Inflate is substantially slower than CodecZlib, Chairmarks reports that it es even slower than BenchmarkTools reports that it is. This is due to methodological difference and it is unclear to me which benchmarking package gives a more "correct" answer. Personally, all else equal, I think it makes sense to use more conservative methodology that reports Inflate as worse because that way once we get numbers below one (i.e. inflate is faster than CodecZlib) we can be more confident that the package is indeed faster.


The main reason for this PR is so that it is faster to iterate on candidate performance improvements to see if they actually speed things up.

@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.35%. Comparing base (f16eec8) to head (0d6d760).
Report is 3 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #23   +/-   ##
=======================================
  Coverage   99.35%   99.35%           
=======================================
  Files           1        1           
  Lines         468      468           
=======================================
  Hits          465      465           
  Misses          3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@GunnarFarneback
Copy link
Owner

Looks good, thanks.

@GunnarFarneback GunnarFarneback merged commit 3c1b9fa into GunnarFarneback:master Sep 23, 2024
17 checks passed
@LilithHafner LilithHafner deleted the lh/chairmarks branch September 23, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants