]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM/MINOR: init/threads: only call protocol_enable_all() on first thread
authorWilly Tarreau <w@1wt.eu>
Mon, 10 Jun 2019 08:14:52 +0000 (10:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 10 Jun 2019 08:53:59 +0000 (10:53 +0200)
commite4d7c9dd65c197b6b948d98a4b9ea11c23f9bdd4
treee940884416f57e75004e241a1b190ead79fe6933
parent71092825774dab100def37e719317188d7eb60fb
OPTIM/MINOR: init/threads: only call protocol_enable_all() on first thread

There's no point in calling this on each and every thread since the first
thread passing there will enable the listeners, and the next ones will
simply scan all of them in turn to discover that they are already
initialized. Let's only initilize them on the first thread. This could
slightly speed up start up on very large configurations, eventhough most
of the time is still spent in the main thread binding the sockets.

A few measurements have constantly shown that this decreases the startup
time by ~0.1s for 150k listeners. Starting all of them in parallel doesn't
provide better results and can still expose some undesired races.
src/haproxy.c