]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: vars: remove the unneeded lock in vars_prune_*
authorWilly Tarreau <w@1wt.eu>
Sun, 15 Sep 2024 21:05:50 +0000 (23:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 15 Sep 2024 21:05:50 +0000 (23:05 +0200)
commitaad6b771dd270680e3cf1850fa47fbfc8d0f1538
treee68f380f2e846d88ef08a1cdc2dbf4edfd575fe7
parent51ade2f1dbf12873d1f56b8d49c75dfe6b2cb34a
OPTIM: vars: remove the unneeded lock in vars_prune_*

vars_prune() and vars_prune_all() take the variable lock while purging
all variables from a head. However this is not needed:
  - proc scope variables are only purged during deinit, hence no lock
    is needed ;
  - all other scopes are attached to entities bound to a single thread
    so no lock is needed either.

Removing the lock saves about 0.5% CPU on variables-intensive setups,
but above all simplify the code, so let's do it.
src/vars.c