Benchmark json-iter, stdlib json and json/v2 - #2107
Merged
Merged
Conversation
liggitt
force-pushed
the
benchjsonv2
branch
3 times, most recently
from
September 8, 2026 16:55
3470a99 to
dd08f42
Compare
Signed-off-by: Jordan Liggitt <liggitt@google.com>
This was referenced Sep 8, 2026
bwplotka
approved these changes
Sep 9, 2026
bwplotka
left a comment
Member
There was a problem hiding this comment.
Thanks!
Some nits, but can be done later across our benchmarks
radianceded
added a commit
to radianceded/client_golang
that referenced
this pull request
Sep 10, 2026
- migrate sequential benchmarks from 'for i := 0; i < b.N; i++' to b.Loop, dropping the now-automatic timer management (ResetTimer / StopTimer around setup); - benchmarks that fan work out to goroutines sized by b.N (benchmarkHistogramObserve/Write, benchmarkSummaryObserve/Write, BenchmarkCounterWithLabelValuesConcurrent) and b.RunParallel (BenchmarkParallelCounter) keep their b.N form, which Loop does not cover; - vec_test's WithLabelValues permutation loop keeps its input rotation via an explicit counter, since Loop does not expose an index; - normalize b.Run case names to key=value so benchstat can project on them: series=/dp=/op=/type=/encoder= in the v1 API benchmarks, size= in the API client, op=/size= in promhttp, and labels=/constraint= in the counter vec table (following prometheus#2107). Fixes prometheus#2113 Signed-off-by: lr <2644847367@qq.com>
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.
Conditionally benchmarks Go 1.27 stdlib json/v2 when run with Go 1.27 (skips json/v2 when not run on Go 1.27). Part of gathering test data for #2105
Reformats the benchmark names to group what is being tested with the different encoder/decoder as the last test name segment
Best reviewed ignoring whitespace - https://github.com/prometheus/client_golang/pull/2107/changes?w=1
cc @bwplotka