Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/fqdn: use LRU in FQDN policy calculation #17224

Merged
merged 1 commit into from
Sep 2, 2021

Commits on Aug 30, 2021

  1. 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>
    aanm authored and pchaigno committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    a6e0c8c View commit details
    Browse the repository at this point in the history