]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: task: change the construction of the loop in process_runnable_tasks()
authorWilly Tarreau <w@1wt.eu>
Sun, 5 Nov 2017 22:57:00 +0000 (23:57 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Nov 2017 10:20:11 +0000 (11:20 +0100)
commitce4e0aa7f387f589e293419269c5641c3966fbbc
treecc04af0c5496d07ec61d1f3b211a4d825993440a
parentb992ba16ef4b7cb3e293a16229e21df599f412b0
MEDIUM: task: change the construction of the loop in process_runnable_tasks()

This patch slightly rearranges the loop to pack the locked code a little
bit, and to try to concentrate accesses to the tree together to benefit
more from the cache.

It also fixes how the loop handles the right margin : now that is guaranteed
that the retrieved nodes are filtered to only match the current thread, we
don't need to rewind every 16 entries. Instead we can rewind each time we
reach the right margin again.

With this change, we now achieve the following performance for 10 H2 conns
each containing 100 streams :

   1 thread : 550kreq/s
   2 thread : 644kreq/s
   3 thread : 598kreq/s
src/task.c