MEDIUM: ring: significant boost in the loop by checking the ring queue ptr first
authorWilly Tarreau <w@1wt.eu>
Sun, 17 Mar 2024 09:20:56 +0000 (10:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Mar 2024 17:34:19 +0000 (17:34 +0000)
commit30a659c3554ce45ae2c280ba02d53a4f6aba17b3
tree81005ae9e68856c2e2ca80eb64336056eb278af6
parent1e2311edbcccf31cbbd9d9ed637eb21187b8910d
MEDIUM: ring: significant boost in the loop by checking the ring queue ptr first

By doing that and placing the cpu_relax at the right places, the ARM
reaches 6.0M/s on 80 threads. On x86_64, at 3C6T the EPYC sees a small
increase from 4.45M to 4.57M but at 24C48T it sees a drop from 3.82M
to 3.33M due to the write contention hidden behind the CAS that
implements the FETCH_OR(), that we'll address next.
src/ring.c