policy: add new benchmarks for identity updates and large policy repository#43407
Merged
christarazi merged 2 commits intocilium:mainfrom Jan 20, 2026
Merged
policy: add new benchmarks for identity updates and large policy repository#43407christarazi merged 2 commits intocilium:mainfrom
christarazi merged 2 commits intocilium:mainfrom
Conversation
Member
Author
|
/test |
Member
Author
|
Looks like tests are failing due to 40f5769. I'll try rebase and rerun |
This new benchmark creates 20k rules and then tries to compute the policies selecting a given identity, where we know non of the rules match. We do this to test the common case in production where a cluster has a lot of rules, where only a handful of them will in practice select each pod. Signed-off-by: Odin Ugedal <odin@ugedal.com> Signed-off-by: Odin Ugedal <ougedal@palantir.com>
a36a602 to
4629342
Compare
Member
Author
|
/test |
This was referenced Dec 17, 2025
This benchmark adds a single wildcard rule, eg. pretty close to the 'cluster' entity. This results in all identities being selected. We then benchmark the performance of adding and removing 10k identities. Today cpu time is heavily spent on sorting the resulting slice. Signed-off-by: Odin Ugedal <odin@ugedal.com> Signed-off-by: Odin Ugedal <ougedal@palantir.com>
4629342 to
d85b916
Compare
Member
Author
|
/test |
Member
Author
|
/ci-ginkgo |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds two distinct new benchmarks. One testing the
resolvePolicyLockedfunction when no/a low number of rules are selected, but when the repository has a lot of rules. The other one testsUpdateIdentitiescalls when a selector has a lot of identities selected.These benchmarks are useful for selectorcache refactors and changes like #43376 and #43368.