-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Don't use CachingObject if the number of watchers is small #84043
Don't use CachingObject if the number of watchers is small #84043
Conversation
@wojtek-t: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@wojtek-t: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
} | ||
|
||
func TestCachingObjects(t *testing.T) { | ||
testCachingObjects(t, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, call these inside subtests so if they fail we know which one it failed on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done (hopefully that's what you meant)
one nit, lgtm otherwise. would be good to get updated numbers on the performance impact of this change before merge |
873132f
to
c5170df
Compare
Update the PR description: @liggitt - PTAL |
that's fine, I mostly wanted numbers to prove this was actually an improvement and there were no unexpected downsides /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, wojtek-t The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
The gain from using CachingObject is huge when there is huge number of watchers (e.g. 5000 kube-proxies, watching all Endpoints objects).
However, if the number of watchers is very small (say 1), creation of the CachingObject itself is unnecessary cost (it results in a bunch of memory allocations):
So only with 3+ watchers the gain starts to be visible.
This PR is changing the logic to use CachingObject only in this case.
The gain in large clusters isn't huge - seem to be ~1-2%, but probably still worth given how small this change is.