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.mddocumentFurther 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,BasicDeliverandChannelCloseto their actual frames:Before
After: