Conversation
|
🔥 Run benchmarks comparing b082698 against gh workflow run bench.yaml -f pr_number=55Note: 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 #55 +/- ##
==========================================
+ Coverage 92.81% 92.94% +0.13%
==========================================
Files 2 2
Lines 487 496 +9
==========================================
+ Hits 452 461 +9
Misses 28 28
Partials 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
benchstats: 6526127...b082698View full benchmark output on the workflow summary. |
1af05bd to
00024a3
Compare
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
Some small optimizations for
MarshalFrame(and therefore alsoWriteFrame) that hopefully do not harm readability/clarity of code. See also #50 forReadFrameoptimizations, from which the we learned some of the tricks below.Summary
Note
👉 With all of these combined, it appears that we've improved
WriteFrame's throughput by ~27%!Each commit represents a separate small optimization, summarized here:
marshaledSize()helper in favor of pre-allocating worst-case buffer size, but that was restored in 00024a3 without meaningful impact on performance)ReadFrame#50,i % N == i & (N - 1)whenNis a power of 2 and bitwise AND is usually a single CPU cycle vs multiple cycles for modulo divisionapplyMask()from perf: optimizeReadFrame#50 in 502dcc3copy()instead ofappend()for writing mask and payload in b082698Final results comparing 6526127 (on
main) vs b082698Copied from workflow summary.
Note: All intermediate results are combined into the edit history of #55 (comment), which shows only the latest results.