]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: map/acl: Improve pat_ref_set_elt() efficiency (for "set-map", "add-acl"action...
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 23 Aug 2023 13:58:26 +0000 (15:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 25 Aug 2023 13:41:59 +0000 (15:41 +0200)
commit745d1a269b3fdc969abbb7181d534f41c2bcd5e8
tree62bb043e2a6fd41057544b67a542d5bc3cb47fbb
parent0844bed7d365c32e39368c9ee072ecb0572c6bde
MEDIUM: map/acl: Improve pat_ref_set_elt() efficiency (for "set-map", "add-acl"action perfs)

Store a pointer to the expression (struct pattern_expr) into the data structure
used to chain/store the map element references (struct pat_ref_elt) , e.g. the
struct pattern_tree when stored into an ebtree or struct pattern_list when
chained to a list.

Modify pat_ref_set_elt() to stop inspecting all the expressions attached to a map
and to look for the <elt> element passed as parameter to retrieve the sample data
to be parsed. Indeed, thanks to the pointer added above to each pattern tree nodes
or list elements, they all can be inspected directly from the <elt> passed as
parameter and its ->tree_head and ->list_head member: the pattern tree nodes are
stored into elt->tree_head, and the pattern list elements are chained to
elt->list_head list. This inspection was also the job of pattern_find_smp() which
is no more useful. This patch removes the code of this function.
include/haproxy/pattern-t.h
src/pattern.c