actix-web icon indicating copy to clipboard operation
actix-web copied to clipboard

actix-http: play with allowing bytes passthrough in the h1 encoder

Open asonix opened this issue 1 year ago • 3 comments

PR Type

?????Bug?????? (reduces memory use)

PR Checklist

  • [ ] Tests for the changes have been added / updated.
  • [x] Documentation comments have been added / updated.
  • [ ] A changelog entry has been made for the appropriate packages.
  • [ ] Format code with the latest stable rustfmt.
  • [ ] (Team) Label with affected crates and semver status.

Overview

This is just me playing around with how to possibly avoid growing a persistent buffer to incredibly large sizes by allowing already-allocated Bytes types to pass through directly to IO in the h1 dispatcher

Comments very welcome

relates to https://github.com/actix/actix-web/issues/3367

asonix avatar May 18 '24 17:05 asonix

I added a couple additional endpoints to the actix-web example in actix-http so I could run wrk against it

CPU: 12th Gen Intel(R) Core(TM) i5-12400 system: Linux firestar 6.9.1 #1-NixOS SMP PREEMPT_DYNAMIC Fri May 17 10:18:09 UTC 2024 x86_64 GNU/Linux

command: wrk -t12 -c400 -d30s $endpoint

for / and /medium performance is similar to the master branch for /large performance is significantly improved

note that this isn't testing streaming bodies

asonix avatar May 19 '24 21:05 asonix

probably semver-major now :) but this is mostly for comment on direction rather than an immediate request to merge

asonix avatar Nov 04 '24 23:11 asonix

related: BigBytes seems like a terrible name and I would love a better one :p

asonix avatar Nov 04 '24 23:11 asonix