]> git.ipfire.org Git - thirdparty/haproxy.git/commit
IMPORT: slz: avoid multiple shifts on 64-bits
authorWilly Tarreau <w@1wt.eu>
Sun, 9 Apr 2023 08:23:18 +0000 (10:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 16 May 2025 14:43:53 +0000 (16:43 +0200)
commitea1b70900f9876a7868f71a28dd0675472ef7e83
tree02ae86f9de110e7abd5a3b93e33645f610ec0f0a
parent0a91c6dcaebd41ead51f3654ca96d564ccda32af
IMPORT: slz: avoid multiple shifts on 64-bits

On 64-bit platforms, disassembling the code shows that send_huff() performs
a left shift followed by a right one, which are the result of integer
truncation and zero-extension caused solely by using different types at
different levels in the call chain. By making encode24() take a 64-bit
int on input and send_huff() take one optionally, we can remove one shift
in the hot path and gain 1% performance without affecting other platforms.

This is slz upstream commit fd165b36c4621579c5305cf3bb3a7f5410d3720b.
src/slz.c