]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: proxy: switch conf.name to cebis_tree
authorWilly Tarreau <w@1wt.eu>
Tue, 15 Jul 2025 09:47:54 +0000 (11:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 16 Sep 2025 07:23:46 +0000 (09:23 +0200)
commitd0d60a007db9623e248f006e7ca8371dab657c9b
treee5e58e1773b7a7f14456a8d20b2ab2b9ad06832d
parentfdf6fd5b456294374d44ce9315de9db871275a47
MEDIUM: proxy: switch conf.name to cebis_tree

This is used to index the proxy's name and it contains a copy of the
pointer to the proxy's name in <id>. Changing that for a ceb_node placed
just before <id> saves 32 bytes to the struct proxy, which is now 3112
bytes large.

Here we need to continue to support duplicates since they're still
allowed between type-incompatible proxies.

Interestingly, the use of cebis_next_dup() instead of cebis_next() in
proxy_find_by_name() allows us to get rid of an strcmp() that was
performed for each use_backend rule. A test with a large config
(100k backends) shows that we can get 3% extra performance on a
config involving a static use_backend rule (3.09M to 3.18M rps),
and even 4.5% on a dynamic rule selecting a random backend (2.47M
to 2.59M).
include/haproxy/proxy-t.h
include/haproxy/proxy.h
src/proxy.c