MEDIUM: pattern: make pat_ref_prune() rely on pat_ref_purge_older()
authorWilly Tarreau <w@1wt.eu>
Tue, 3 Nov 2020 09:37:31 +0000 (10:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 5 Nov 2020 18:27:09 +0000 (19:27 +0100)
commitae83e63b487bf41666d0efd641d2dea9d2c283d2
treee2ff5c26fe4111c486312e376462d69f0f26b16c
parent94b9abe2009cc5f2f35bee6491e424ba1fcaec61
MEDIUM: pattern: make pat_ref_prune() rely on pat_ref_purge_older()

When purging all of a reference, it's much more efficient to scan the
reference patterns from the reference head and delete all derivative
patterns than to scan the expressions. The only thing is that we need
to proceed both for the current and next generations, in case there is
a huge gap between the two. With this, purging 20M IP addresses in small
batches of 100 takes roughly 3 seconds.
src/pattern.c