-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/fqdn: use LRU in FQDN policy calculation
Using an LRU for the memory-intensive operations such as regex.Compile bring some benefits as presented in the following benchmarks [1]. These benchmarks assumed there were 2 CNPs that shared 100 FQDN `matchPattern` on a node with 20 endpoints. [1] ``` name old time/op new time/op delta _perEPAllow_setPortRulesForID-8 13.9ms ± 6% 1.2ms ±63% -91.10% (p=0.008 n=5+5) name old alloc/op new alloc/op delta _perEPAllow_setPortRulesForID-8 17.4MB ± 0% 0.6MB ± 0% -96.56% (p=0.008 n=5+5) name old allocs/op new allocs/op delta _perEPAllow_setPortRulesForID-8 42.8k ± 0% 8.1k ± 0% -81.13% (p=0.008 n=5+5) ``` Signed-off-by: André Martins <andre@cilium.io>
- Loading branch information
Showing
3 changed files
with
84 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters