]> git.kaiwu.me - haproxy.git/commit
OPTIM/MEDIUM: proxy: avoid main proxies list reordering on startup
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 22 Jul 2026 14:13:42 +0000 (16:13 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Jul 2026 14:03:20 +0000 (16:03 +0200)
commit869163e10e4c66924a4b82d953aefed5f77031c0
treee0dd6b2250fe7a2b86041c5956a3c3ec3427ad33
parentb6bb1bd741930cff6bd3c25a1a32918374702003
OPTIM/MEDIUM: proxy: avoid main proxies list reordering on startup

Prior to this patch, proxies were added in front ot the visible proxies
list, resulting in the reverse order of their parsing. The list was then
reversed once parsing was completed to reflect the configuration order.
This was performed for performance reason, as visible proxies list was
simply linked.

This list has recently been converted to a doubly linked struct list.
Thus, it is now possible to append a newly parsed proxy at the end of
the list in constant time.

Thus, with this patch, a newly parsed instance is now directly inserted
at the end of main proxies list. This is implemented by updating
main_proxies_register() wrapper. Post-config performance are slightly
improved as reversal is now unneeded.
include/haproxy/proxy.h
src/cfgparse.c
src/proxy.c