]> git.kaiwu.me - haproxy.git/commit
MINOR: hpack: simplify the len to bytes conversion
authorWilly Tarreau <w@1wt.eu>
Mon, 10 Dec 2018 12:36:56 +0000 (13:36 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 11 Dec 2018 08:06:46 +0000 (09:06 +0100)
commit1526f1942c1c67cb6c1b82750dbb2e3374b4792f
tree1b27a9cbd7411fc3986cd24c465b6965f6727fe0
parent2df026fbce8e5686c5639235c5ff0a54ffc5a817
MINOR: hpack: simplify the len to bytes conversion

The len-to-bytes conversion can be slightly simplified and optimized
by hardcoding a tree lookup. Just doing this increases by 1% the
request rate on H2. It could be made almost branch-free by using
fls() but it looks overkill for most situations since most headers
are very short.
src/hpack-enc.c