]> git.kaiwu.me - haproxy.git/commit
OPTIM/MEDIUM: proxy/server: avoid server list reordering on startup
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 22 Jul 2026 13:51:29 +0000 (15:51 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 24 Jul 2026 07:34:44 +0000 (09:34 +0200)
commit029add93aeec169c7c0648e04b8d2f6c13a151b6
treed41efb597a9ec63fd4d691cace801b5b6aefe0f7
parent81fc22033596b615c30b752a68a0bf22a7c52bd8
OPTIM/MEDIUM: proxy/server: avoid server list reordering on startup

Prior to this patch, each server parsed from the configuration was added
at the front of the proxy list. The list was then reversed once parsing
is finished to reflect the configuration order.

Now that proxy servers list has been converted to a doubly linked list,
there is no more a reason for this. Thus, this patch changes the server
insertion order on configuration parsing : this is now performed
directly at the end of the proxy list. Reversal is unnecessary and has
been removed, so post-config performance may be slightly improved.

Peers parsing is the only module which relies on the order insertion.
Thus it has been adapted to now use the last server in its proxy.
include/haproxy/proxy.h
src/cfgparse-peers.c
src/proxy.c
src/server.c