forked from apple/swift-nio-http2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid CoW when appending inbound frame bytes. (apple#111)
Motivation: This is basically a similar issue to apple#104: we have a CoW data structure (ByteBuffer) in some of these states, and when calling append on them they force an unnecessary CoW. We can reproduce the fix from that patch, which is to define an empty state and swap into it before we run the append. We also define a helper that ensures that we don't screw this up. Modifications: - Added new appending state to HTTP2FrameDecoder - Added helpers for avoiding a CoW - Avoided CoW in HTTP2FrameDecoder. Result: Fewer unnecessary copies
- Loading branch information
Showing
1 changed file
with
70 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters