]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[OPTIM] freq_ctr: do not rotate the counters when reading
authorWilly Tarreau <w@1wt.eu>
Fri, 6 Mar 2009 13:29:25 +0000 (14:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 6 Mar 2009 13:29:25 +0000 (14:29 +0100)
commit3d8c5531d81dfc6b7d1ed3ec80aa8fb3563d598a
tree9a941f5817d3a383080818369005ec38f199d65c
parentec22b2c27ace5a267dc736afb04c5dd107bf1d62
[OPTIM] freq_ctr: do not rotate the counters when reading

It's easier to take the counter's age into account when consulting it
than to rotate it first. It also saves some CPU cycles and avoids the
multiply for outdated counters, finally saving CPU cycles here too
when multiple operations need to read the same counter.

The freq_ctr code has also shrinked by one third consecutively to these
optimizations.
src/freq_ctr.c