OPTIM: vars: remove internal bookkeeping for vars_global_size
authorWilly Tarreau <w@1wt.eu>
Wed, 8 Sep 2021 13:40:58 +0000 (15:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 8 Sep 2021 13:45:05 +0000 (15:45 +0200)
commit3b78f2aa5ded32126fe20093d63d37d39d468e1a
tree4bbf9fc5f2c9b2f6bc154e5e1223779df9a26aec
parent61ecf2838991a659127e90c00f8302e430e5076b
OPTIM: vars: remove internal bookkeeping for vars_global_size

Right now we have a per-process max variable size and a per-scope one,
with the proc scope covering all others. As such, the per-process global
one is always exactly equal to the per-proc-scope one. And bookkeeping
on these process-wide variables is extremely expensive (up to 38% CPU
seen in var_accounting_diff() just for them).

Let's kill vars_global_size and only rely on the proc one. Doing this
increased the request rate from 770k to 1.06M in a config having only
12 variables on a 16-thread machine.
src/vars.c