arturobernalg opened a new pull request, #1255:
URL: https://github.com/apache/tomcat/pull/1255

   `HPackHuffman.decode` walks the code tree one bit at a time. Profiling 
Tomcat under HTTP/2 load with the JDK `HttpClient` (which sends header values 
as Huffman literals on every request rather than indexing them) showed about 
26% of server CPU in this method.
   
   This replaces the tree walk with a table indexed by eight bits of input, as 
other HPACK implementations do.
   
   - Decoding is about 3x faster (the common request header values: 2.8 us -> 
0.9 us; short `:path` values about 2x).
   - - Results are identical to the current decoder, including which of the 
three RFC 7541 5.2 errors is raised, over 1.5M random and malformed inputs.
   - - h2c, 1 KB static resource, server pinned to two cores: +12% requests/s, 
-12% CPU per request with the JDK client. With a client that indexes headers 
(curl/nghttp2) only `:path` is Huffman decoded per request, so there is no 
measurable end-to-end difference.
   Added tests for the Huffman literals in the RFC 7541 appendix C examples and 
for the decoding errors. The HTTP/2 tests and the smoke profile pass.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to