You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-29 23:07:45 +02:00
`BenchmarkValueEqual` does not run the target code with `b.N`, as https://pkg.go.dev/testing#hdr-Benchmarks states. Thus, it cannot produce a stable benchmark result. And, it would fail the benchmark: https://github.com/open-telemetry/opentelemetry-go/actions/runs/10412186663. This PR fixes this issue. Here is the result of `benchstat` ``` goos: darwin goarch: arm64 pkg: go.opentelemetry.io/otel/log │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ ValueEqual/2_with_1-10 0.0000002000n ± 100% 3.1450000000n ± 1% +1572499900.00% (p=0.000 n=10) │ old.txt │ new.txt │ │ B/op │ B/op vs base │ ValueEqual/2_with_1-10 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹ ¹ all samples are equal │ old.txt │ new.txt │ │ allocs/op │ allocs/op vs base │ ValueEqual/2_with_1-10 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹ ¹ all samples are equal ```