]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: pattern: do not needlessly lookup the LRU cache for empty lists
authorWilly Tarreau <w@1wt.eu>
Tue, 22 Aug 2023 05:22:05 +0000 (07:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Aug 2023 05:27:01 +0000 (07:27 +0200)
commit821fc95146ca9bc79f0e890d8c648203c2756583
tree33c3ddfbe7abe769d0bd6095d769b817c058e691
parent3fde27d980f2f9a93a69889e5fcac5fad7edc632
MINOR: pattern: do not needlessly lookup the LRU cache for empty lists

If a pattern list is empty, there's no way we can find its elements in
the pattern cache, so let's avoid this expensive lookup. This can happen
for ACLs or maps loaded from files that may optionally be empty for
example. Doing so improves the request rate by roughly 10% for a single
such match for only 8 threads. That's normal because the LRU cache
pre-creates an entry that is about to be committed for the case the list
lookup succeeds after a miss, so we bypass all this.
src/pattern.c