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
Add benchmark for json.compact high cpu usage in watch #113326
Conversation
/retest |
/assign @lavalamp as Wojtek is OOO |
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.
Benchmark refactors here look good.
/lgtm
@@ -878,7 +879,7 @@ func BenchmarkWatchHTTP(b *testing.B) { | |||
item.Name = fmt.Sprintf("reasonable-name-%d", i) |
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: self-links were removed, may or may not be useful to remove these, perhaps in some follow-up
staging/src/k8s.io/apiserver/pkg/storage/cacher/caching_object.go
Outdated
Show resolved
Hide resolved
/retest |
This looks great now - thanks @mborsz ! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mborsz, 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 |
/triage accepted |
/retest |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Adds repro benchmark for #110146
It also does tiny refactor of existing benchmark, with no performance diff:
BenchmarkWatchCachingObjectJSON properly reproduces #110146:
Such branch isn't visible for BenchmarkWatchCachingObjectProtobuf:
Special notes for your reviewer:
It makes CachingObject public so that we can reuse it for performance testing. Alternative approach would be to reimplement some simpler mock, if prefered.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/assign @wojtek-t (for comments on making CachingObject public)
Wojtek, is it OK to make this public or we prefer to implement fakeCachingObject in the watch_test.go?