-
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
Use more real world examples in BenchmarkSerializeObject #99192
Conversation
@wojtek-t, as discussed offline: I changed this PR to avoid uploading 2.5MB serialized protobuf. Instead I upload a pod template and modify fields that differs between pods in the same deployment (generated using diff). It seems to work pretty well. |
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.
This is great - just one comment.
func BenchmarkSerializeObject10KB(b *testing.B) { | ||
benchmarkSerializeObject(b, 10*1024) | ||
func BenchmarkSerializeObject1000PodsPB(b *testing.B) { | ||
benchmarkSerializeObject(b, toProtoBuf(b, benchmarkItems(b, "testdata/pod.json", 1000))) |
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.
You may want to reset the time after computing benchmark items, something like:
items := benchmarkItems(...)
b.ResetTimer()
benchmarkSerializeObject(...)
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.
Ok - it's done later anyway. Never mind.
/lgtm |
This is great! /kind cleanup |
[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 |
/retest Review the full test history for this PR. Silence the bot with an |
/triage accepted |
What type of PR is this?
What this PR does / why we need it:
It changes BenchmarkSerializeObject to use slightly more real-world example:
And then dumped one of pods as a json.
To be clear: This example is still far from perfect example (as in real world clusters we expect to see some configmaps, more labels, secrets, volumes etc), but at least has some pod-like structure (status, conditions, uuids).
Current result:
/assign @wojtek-t
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: