]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: stick-table: avoid atomic ops in stktable_requeue_exp() when possible
authorWilly Tarreau <w@1wt.eu>
Mon, 14 Nov 2022 16:54:07 +0000 (17:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Nov 2022 17:20:38 +0000 (18:20 +0100)
commit3238f79d12871937c55ff05f2853679a0d511420
tree0e1fea013d0fefb88e74744b1b59a2b9506c0b60
parent63427140527bcd0e45fe4a7a574cc5db0b5141e6
OPTIM: stick-table: avoid atomic ops in stktable_requeue_exp() when possible

Since the task's time resolution is the millisecond we know there
will not be more than 1000 useful updates per second, so there's no
point in doing a CAS and a task_queue() for each call, better first
check if we're going to change the date. Now we're certain not to
perform such operations more than 1000 times a second for a given
table.

The loop was modified because this improvement will also be used to fix a
bug later.
src/stick_table.c