]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: debug: add a trivial PRNG for scheduler stress-tests
authorWilly Tarreau <w@1wt.eu>
Mon, 30 Nov 2020 15:17:33 +0000 (16:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 30 Nov 2020 16:07:32 +0000 (17:07 +0100)
commit8a069eb9a4b34e48ea41ac0e270cd2ccbd6fe3e8
tree40ebf0d8031514f9a9d24e967d7f2b866daf34a3
parenta5a447984900cff138e9f2c94afbcd10dbdb0d1a
MINOR: debug: add a trivial PRNG for scheduler stress-tests

Commit a5a447984 ("MINOR: debug: add "debug dev sched" to stress the
scheduler.") doesn't scale with threads because ha_random64() takes care
of being totally thread-safe for use with UUIDs. We don't need this for
the stress-testing functions, let's just implement a xorshift PRNG
instead. On 8 threads the performance jumped from 230k ctx/s with 96%
spent in ha_random64() to 14M ctx/s.
src/debug.c