http-2 icon indicating copy to clipboard operation
http-2 copied to clipboard

10x performance improvements

Open HoneyryderChuck opened this issue 8 months ago • 1 comments
trafficstars

This is a long batch of changes which I've been slowly patching and testing locally towards improving the performance of the "happy path" of a burst of multiple simultaneous streams on a single connection.

The first commit includes the baseline benchmark (using the singed gem to generate flamegraphs for analysis).

The full changeset will be hard to review. The suggestion is to review each commit separately, as they're all self-contained, and the commit message contains context about the change.

These are the measurements using the benchmark library for 5000 streams over a connection:

BENCH=benchmark bundle exec ruby benchmarks/client_server.rb
# before
6.682099  15.267209  21.949308 ( 22.052998)
# after
0.984433   0.113971   1.098404 (  1.100675)

HoneyryderChuck avatar Mar 14 '25 23:03 HoneyryderChuck

👏🏻

igrigorik avatar Mar 15 '25 05:03 igrigorik

I can do a review this week, but it would have been helpful to slice this up into chunks. Are all of the changes related to performance? I see rbs and other refactorings.

mullermp avatar Mar 15 '25 16:03 mullermp

@mullermp I understand. I think it's more digestible if you go commit by commit, as each change is independent and context is in the commit message. I don't think it'd help much by making each commit its own MR at this point, but I concede that this may not fit everyone's preferred review workflow.

Are all of the changes related to performance?

I went back to the commit list to keep me honest. I counted only one commit which isn't specifically about performance. RBS changes are about method sig changes, and inconsistencies found as a result of the changes.

HoneyryderChuck avatar Mar 15 '25 23:03 HoneyryderChuck

@mullermp I did run a few sanity tests 👍

HoneyryderChuck avatar Mar 22 '25 01:03 HoneyryderChuck