]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[OPTIM] task: reduce the number of calls to task_queue()
authorWilly Tarreau <w@1wt.eu>
Sun, 8 Mar 2009 15:35:27 +0000 (16:35 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 8 Mar 2009 15:35:27 +0000 (16:35 +0100)
commit531cf0cf8d2974bb9edd8dbf7c37d506e4fac709
tree52f7abbc2ead1ead4a56f89519e79282a6be6718
parentd0a201b35ce35555ea7cce172dde27c528ec038a
[OPTIM] task: reduce the number of calls to task_queue()

Most of the time, task_queue() will immediately return. By extracting
the preliminary checks and putting them in an inline function, we can
significantly reduce the number of calls to the function itself, and
most of the tests can be optimized away due to the caller's context.

Another minor improvement in process_runnable_tasks() consisted in
taking benefit from the processor's branch prediction unit by making
a special case of the process_session() callback which is by far the
most common one.

All this improved performance by about 1%, mainly during the call
from process_runnable_tasks().
include/common/ticks.h
include/proto/task.h
src/task.c