]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[OPTIM] halog: add assembly version of the field lookup code
authorWilly Tarreau <w@1wt.eu>
Sat, 10 Sep 2011 10:26:35 +0000 (12:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 10 Sep 2011 10:39:30 +0000 (12:39 +0200)
commitf9042060c9db073e3e4143b87fec236c4f9f4e74
treec0052663ea8b4a8d36503840e6e571456a943b8d
parent31a02e9c5bbfc36da3e84cb13e3a48086485beb1
[OPTIM] halog: add assembly version of the field lookup code

Gcc tries to be a bit too smart in these small loops and the result is
that on i386 we waste a lot of time there. By recoding these loops in
assembly, we save up to 23% total processing time on i386! The savings
on x86_64 are much lower, probably because there are more registers and
gcc has to do less tricks. However, those savings vary a lot between gcc
versions and even cause harm on some of them (eg: 4.4) because gcc does
not know how to optimize the code once inlined.

However, by recoding field_start() in C to try to match the assembly
code as much as possible, we can significantly reduce its execution
time without risking the negative impacts. Thus, the assembly version
is less interesting there but still worth being used on some compilers.
contrib/halog/halog.c