Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce initial size of listeners queue in
WriteStreamSubscriber
(#1465
) Motivation: Most of the write HTTP messages have 3 listeners, because it consist of headers, one payload body chunk (can be empty), and trailers. `ArrayDeque` defines `MIN_INITIAL_CAPACITY = 8` internally. It's sufficient for most use-cases. Messages with large streaming payload body may have more listeners, but those messages have higher overhead anyway (flush-on-each, etc.). Therefore, it's ok for them to resize the queue, if necessary. Modifications: - Define the default size of 8 for `listenersOnWriteBoundaries` in `WriteStreamSubscriber.AllWritePromise`; Result: Less allocation per each message write.
- Loading branch information