]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: tools: optimize my_ffsl() for x86_64
authorWilly Tarreau <w@1wt.eu>
Wed, 10 Oct 2018 17:05:56 +0000 (19:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 10 Oct 2018 17:24:23 +0000 (19:24 +0200)
commit27346b01aaa1e5f65dcd737e96bc1a4d46a6dd2a
tree5f498df50847e6fa6694df4544b46ddb0ffbb3bc
parent2325d8af93ae2f044432b903a25e702f17cedff3
OPTIM: tools: optimize my_ffsl() for x86_64

This call is now used quite a bit in the fd cache, to decide which cache
to add/remove the fd to/from, when waking up a task for a single thread
in __task_wakeup(), in fd_cant_recv() and in fd_process_cached_events(),
and we can replace it with a single instruction, removing ~30 instructions
and ~80 bytes from the inner loop of some of these functions.

In addition the test for zero value was replaced with a comment saying
that it is illegal and leads to an undefined behaviour. The code does
not make use of this useless case today.
include/common/standard.h