mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2024-12-26 21:05:00 +02:00
5b2ce02911
`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 ``` |
||
---|---|---|
.. | ||
embedded | ||
global | ||
internal/global | ||
logtest | ||
noop | ||
DESIGN.md | ||
doc.go | ||
go.mod | ||
go.sum | ||
keyvalue_bench_test.go | ||
keyvalue_test.go | ||
keyvalue.go | ||
kind_string.go | ||
logger_test.go | ||
logger.go | ||
provider.go | ||
README.md | ||
record_bench_test.go | ||
record_test.go | ||
record.go | ||
severity_string.go | ||
severity_test.go | ||
severity.go |