-
Notifications
You must be signed in to change notification settings - Fork 580
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
Framing benchmarks and optimizations #1016
Framing benchmarks and optimizations #1016
Conversation
Nice improvements! Looks very much worth it. Some of your improvements I also applied in #962, so we should look how we coordinate these two PRs to get the maximum out of it 🔥 🚀 Out of curiosity, while changing it, what change did bring the most benefit? Is shifting & then write as ulong that much faster? |
The UInt64 change helped get rid of method calls and calls to Span.Slice, which even if they are cheap, add up quickly on a hot-path, made the Write* calls smaller (Code size) which made them more inlineable. The biggest factor was splitting up I have an idea for a few more optimizations which I'll try out tomorrow. |
e08aa7f
to
3d920cd
Compare
Rebased and squashed after reviews. |
6f9ddb0
to
e02e86f
Compare
Updated with latest perf numbers |
Anyone want to do a final review of this? If not, I think this PR is ready :) @michaelklishin @danielmarbach @bollhals |
Go for it. I'll update #962 afterwards to pickup these improvements and extend where possible. |
Proposed Changes
Added benchmarks for frame generation and added optimizations which should benefit all commands sent from the clients.
Types of Changes
Checklist
CONTRIBUTING.md
documentFurther Comments
Main optimizations were done by reducing method calls, adding inlining and reducing code branches. There is definitely room for more improvements, but this is a pretty solid start :)
Benchmark results for serializing
BasicAck
,BasicDeliver
andChannelClose
to their actual frames:Before
After: