-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
Optimize varint parsing #337
Conversation
Codecov Report
@@ Coverage Diff @@
## master #337 +/- ##
==========================================
- Coverage 61.40% 61.35% -0.06%
==========================================
Files 11 11
Lines 824 828 +4
==========================================
+ Hits 506 508 +2
- Misses 318 320 +2
Continue to review full report at Codecov.
|
Looking at this I'm not sure how is can increase performance, since its just calling the same methods we already called before. The main reason |
Oh hi that's me. Sorry, this got put at the end of the queue when I became busy and never made its way back up. The short answer to "how can this increase performance" is that the code paths in byteorder all use the To actually realize this improvement, an implementor of |
Codecov Report
@@ Coverage Diff @@
## master #337 +/- ##
==========================================
+ Coverage 61.40% 64.44% +3.04%
==========================================
Files 11 11
Lines 824 827 +3
==========================================
+ Hits 506 533 +27
+ Misses 318 294 -24
Continue to review full report at Codecov.
|
Looks good to me, @saethlin do you still want to check if this fixes your performance issues? |
@VictorKoenders Thanks for the attention. I'd like to assemble a microbenchmark or two that we can add to this repo to back up these changes. I'm a bit busy at the moment but I should get to this in the next few days. |
Codecov Report
@@ Coverage Diff @@
## trunk #337 +/- ##
========================================
Coverage ? 62.45%
========================================
Files ? 10
Lines ? 871
Branches ? 0
========================================
Hits ? 544
Misses ? 327
Partials ? 0
Continue to review full report at Codecov.
|
I've force-pushed a new set of commits, which start with adding benchmarks. Anyone interested should be able to check out each commit and run
There's definitely more work that could be done here, but I'm personally careful about scope creep. On the |
Based on the observation that
|
The regression is real, but I truly have no idea why. I cannot distinguish any semantic difference between the instructions that are generated for the benchmark between commits. At a guess, it's a code layout mistake. I can get the faster codegen again by turning on LTO, which suggests that is the case because there's no reason symbol visibility should matter, but running passes in a different order often produces random optimizations and regressions. |
With the latest commit, all the benchmarks inline everything into one blob. So basically, we've peaked. Improvements from here on are almost certainly quite marginal. Unless anyone has ideas on why the
|
Sorry this has taken so long! This all looks great. |
@ZoeyR After this meets with your approval I'd like the chance to verify that it fixes the performance issue we're seeing before you merge.