hyper-staticfile icon indicating copy to clipboard operation
hyper-staticfile copied to clipboard

[Tracking] Potential performance improvements

Open lnicola opened this issue 6 years ago • 0 comments

In my quick tests, there is some room for improvement in the performance of this crate. We discussed some ideas in #23, mainly:

  • increasing the read buffer size or making it configurable
  • using BytesMut to reduce allocations
  • introducing a small amount buffering so that one chunk can be read from disk while another is being sent over the network

I'm filing this as somewhat of a tracking issue, because I don't think it's worth trying to work on it right now. The buffer size change is partially blocked because tokio limits the read size to 16 KB (https://github.com/tokio-rs/tokio/issues/1976). And in my tests I couldn't get consistent performance, likely because of extra context switching in tokio (https://github.com/tokio-rs/tokio/issues/1844).

lnicola avatar Dec 17 '19 17:12 lnicola