Closed seanmonstar closed 6 months ago
I've tried this change. All tests are passing.
My observation on production-like traffic: https://github.com/tokio-rs/axum/discussions/2381#discussioncomment-8749626
Published in http-body-util v0.1.1.
Thanks! We've updated, and the performance issues are fixed for us.
Using
take(len)
costs a bit in performance. If copying the full thing (which is whatCollected::to_bytes()
does), we can skip usingtake(n)
and see a significant speed up.Using hyper's body benchmarks, on my tiny VM, the perf improvement is from 5GB/s to 31GB/s.