perf: eliminate bounds checks in applyMask#53
Merged
Conversation
|
🔥 Run benchmarks comparing c168278 against gh workflow run bench.yaml -f pr_number=53Note: this comment will update with each new commit. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #53 +/- ##
==========================================
+ Coverage 92.76% 92.81% +0.04%
==========================================
Files 2 2
Lines 484 487 +3
==========================================
+ Hits 449 452 +3
Misses 28 28
Partials 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
benchstats: 3cb163b...c168278View full benchmark output on the workflow summary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
A small follow-up to #50, inspired by this blog post by @jub0bs that walks through optimizing away bounds checks (as well as enabling inlining).
Note, there are still two bounds checks per
applyMask(), on line 494 and line 504:But that's an improvement on the 9 bounds checks we were seeing previously:
Results
A nice little ~4.5% improvement to throughput according to the results posted below:
Edit: realized after the fact that I didn't actually link to the blog post that showed me how to do this!