CLEANUP: pools: uninline pool_put_to_cache()
authorWilly Tarreau <w@1wt.eu>
Mon, 19 Apr 2021 09:49:26 +0000 (11:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 19 Apr 2021 13:24:33 +0000 (15:24 +0200)
commitb2a853d5f0b13990e0117e340a2b11b0b678464e
tree94c32f4658be314890072f7d577c2972c63e918a
parent43d4ed548f78bf83e4ade45f1960333fbdfaeb67
CLEANUP: pools: uninline pool_put_to_cache()

This function has become too big (251 bytes) and is now hurting
performance a lot, with up to 4% request rate being lost over the last
pool changes. Let's move it to pool.c as a regular function. Other
attempts were made to cut it in half but it's still inefficient. Doing
this results in saving ~90kB of object code, and even 112kB since the
pool changes, with code that is even slightly faster!

Conversely, pool_get_from_cache(), which remains half of this size, is
still faster inlined, likely in part due to the immediate use of the
returned pointer afterwards.
include/haproxy/pool.h
src/pool.c