-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize encoding of HTTP/2 frames to write less on the wire (#1518)
Motivation: We can infer from the `PayloadInfo` when HTTP message does not contain payload body or trailers. In this case, we can write it in a single frame. Also, we do not need to write `Http2DataFrame`(s) for empty `Buffer`(s) or process `HttpHeaders` when it's empty. Modifications: - Detect if the `HttpMetaData` can be written in a single frame; - Emit `CloseHandler#protocolPayloadEndOutbound` on `endStream`; - Ignore empty `Buffer`(s) when writing `Http2DataFrame`(s); - Do not process `HttpHeaders` when they are empty; - Add tests for new behavior; Result: Less `Http2StreamFrame`(s) allocated and written on the wire, results in +10% RPS, -12% latency for some HTTP/2 use-cases.
- Loading branch information
1 parent
2bc89b5
commit edc0e6d
Showing
10 changed files
with
189 additions
and
31 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
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
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
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
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
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
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
Oops, something went wrong.