Skip to content

Conversation

driftluo
Copy link
Collaborator

@driftluo driftluo commented Mar 3, 2025

#398 use extend_from_slice will copy all data twice, this pr use Vec<BytesMut> reduces its copy from all data to just one ptr, and Vec's memory allocation and release do not always work, because drain does not reclaim memory, that is, the memory allocation operation here is limited

bench master and this pr:

master branch:

Gnuplot not found, using plotters backend
yamux_beach/            time:   [475.10 µs 544.57 µs 618.04 µs]                         
                        change: [-5.0316% +12.625% +35.408%] (p = 0.20 > 0.05)
                        No change in performance detected.
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild

this pr:

Gnuplot not found, using plotters backend
yamux_beach/            time:   [393.64 µs 451.65 µs 514.75 µs]                         
                        change: [-34.776% -23.230% -8.6939%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild

@driftluo driftluo requested a review from quake March 3, 2025 03:29
@driftluo driftluo requested a review from eval-exec as a code owner March 3, 2025 03:30
@driftluo driftluo force-pushed the perf-yamux-read branch 3 times, most recently from c6a0ca8 to 3f511b6 Compare March 3, 2025 06:53
@driftluo driftluo force-pushed the perf-yamux-read branch 2 times, most recently from de35f34 to 02b4d3e Compare March 3, 2025 12:47
@driftluo driftluo requested a review from quake March 4, 2025 07:38
@driftluo driftluo merged commit 8729dbc into master Mar 4, 2025
7 checks passed
@driftluo driftluo deleted the perf-yamux-read branch March 4, 2025 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants