benchmark(endpoint): endpoint benchmarks#6156
benchmark(endpoint): endpoint benchmarks#6156k8s-ci-robot merged 5 commits intokubernetes-sigs:masterfrom
Conversation
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
a0abe83 to
1bf3e63
Compare
Pull Request Test Coverage Report for Build 21543315090Details
💛 - Coveralls |
3020f8a to
ad5334f
Compare
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
ad5334f to
850eef4
Compare
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
| for _, setProps := range setPropsOptions { | ||
| for _, epCount := range endpointCounts { | ||
| endpoints := generateBenchmarkEndpoints(epCount, setProps) | ||
| b.Run(fmt.Sprintf("slice/set=%d/endpoints=%d", setProps, epCount), func(b *testing.B) { |
There was a problem hiding this comment.
should not we add here a b.ResetTimer() ?
There was a problem hiding this comment.
I could add, but does not look where or not is required. Let me know, if you still this is required, I'll add it for extra protection.
The generateBenchmarkEndpoints call on line 79 is outside the b.Run sub-benchmark. Each sub-benchmark gets its own b with its own timer that starts when b.Run's function begins - so the setup cost of generateBenchmarkEndpoints is not measured.
Contrast with BenchmarkProviderSpecificDelete (line 106-107): there, generateBenchmarkEndpoints is called inside b.Run, so b.ResetTimer() is used to exclude that setup from the measurement.
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: szuecs The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What does it do ?
Benchmark tests, full version here gofogo#62
The tests mimics our use case. In theory, the slice should be faster on smallet sets of properites, due to map hashing overhead and slice byt-by-byte comparison, same time technically there are all sorts of overhead
Motivation
This work related to #5814
Basically just adding benchamakrs for future. I think it is worth to keep it in the repo. And in follow-up we have baseline tests for comparison Slice vs Map
More