You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Future objects in rust can easily grow to be several KBs. If we have a
thousand open connections each being handled by a multi KB future then
we're using MBs of memory. Most of this memory is wasted because the
connections sit idle most of the time and it's unlikely that more than a
dozen connections will ever be handling a request at the same time.
This change introduces a RequestListener that is optimized to reduce the
memory usage of idle connections. The RequestListener dynamically heap
allocates the futures for handling requests so the memory of these
futures isn't consumed while the connections are idle.
RequestListener manually implements Future to work around
rust-lang/rust#62958 and
rust-lang/rust#108906. This further reduces
the size of an idle RequestListener to typically less than 80 bytes.
RequestListener only reduces the idle memory overhead of the futures
downstream from itself. There's still work to be done to reduce the size
of futures upstream from the RequestListeners.
Bug: 398886282
Change-Id: I30bd18099de05bd57639df69d88d011f21c03335
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1198690
Commit-Queue: Chris Drouillard <[email protected]>
Reviewed-by: Chris Suter <[email protected]>
0 commit comments