]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: guid: switch guid to more compact cebuis_tree
authorWilly Tarreau <w@1wt.eu>
Mon, 17 Feb 2025 08:39:04 +0000 (09:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 16 Sep 2025 07:23:46 +0000 (09:23 +0200)
commit91258fb9d899640184e4f89308092b481c861c0d
tree8948e41f2a7061187cf3080a3b5a0b8d1ba67754
parente36b3b60b3fcf24e327fe398541aa302802bf521
MEDIUM: guid: switch guid to more compact cebuis_tree

The current guid struct size is 56 bytes. Once reduced using compact
trees, it goes down to 32 (almost half). We're not on a critical path
and size matters here, so better switch to this.

It's worth noting that the name part could also be stored in the
guid_node at the end to save 8 extra byte (no pointer needed anymore),
however the purpose of this struct is to be embedded into other ones,
which is not compatible with having a dynamic size.

Affected struct sizes in bytes:

           Before     After   Diff
  server    4032       4032     0*
  proxy     3184       3160    -24
  listener   752        728    -24

*: struct server is full of holes and padding (176 bytes) and is
64-byte aligned. Moving the guid_node elsewhere such as after sess_conn
reduces it to 3968, or one less cache line. There's no point in moving
anything now because forthcoming patches will arrange other parts.
include/haproxy/guid-t.h
include/haproxy/guid.h
src/counters.c
src/guid.c
src/stats-file.c