1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-08-10 22:31:50 +02:00
Files
opentelemetry-go/baggage
Sean Liao a571c52b0a all: replace math/rand with math/rand/v2 (#6732)
Update to new stdlib apis.

The new Float64 is uniform, which resolves a long comment.


https://cs.opensource.google/go/go/+/refs/tags/go1.24.2:src/math/rand/v2/rand.go;l=209

> // There are exactly 1<<53 float64s in [0,1). Use Intn(1<<53) /
(1<<53).
	return float64(r.Uint64()<<11>>11) / (1 << 53)

```
goos: linux
goarch: amd64
pkg: go.opentelemetry.io/otel/sdk/trace
cpu: 12th Gen Intel(R) Core(TM) i7-1260P
                                 │   old.txt    │               new.txt                │
                                 │    sec/op    │    sec/op     vs base                │
TraceStart/with_a_simple_span-16   387.1n ±  5%   306.8n ± 15%  -20.73% (p=0.000 n=10)
TraceStart/with_several_links-16   542.2n ±  5%   501.0n ±  2%   -7.61% (p=0.000 n=10)
TraceStart/with_attributes-16      521.4n ± 14%   571.6n ±  6%   +9.64% (p=0.009 n=10)
geomean                            478.3n         444.6n         -7.05%

                                 │  old.txt   │               new.txt               │
                                 │    B/op    │    B/op     vs base                 │
TraceStart/with_a_simple_span-16   528.0 ± 0%   528.0 ± 0%       ~ (p=1.000 n=10) ¹
TraceStart/with_several_links-16   704.0 ± 0%   704.0 ± 0%       ~ (p=1.000 n=10) ¹
TraceStart/with_attributes-16      784.0 ± 0%   784.0 ± 0%       ~ (p=1.000 n=10) ¹
geomean                            663.0        663.0       +0.00%
¹ all samples are equal

                                 │  old.txt   │               new.txt               │
                                 │ allocs/op  │ allocs/op   vs base                 │
TraceStart/with_a_simple_span-16   2.000 ± 0%   2.000 ± 0%       ~ (p=1.000 n=10) ¹
TraceStart/with_several_links-16   3.000 ± 0%   3.000 ± 0%       ~ (p=1.000 n=10) ¹
TraceStart/with_attributes-16      4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                            2.884        2.884       +0.00%
¹ all samples are equal
```

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
2025-05-15 09:21:49 +02:00
..
2024-03-26 20:13:54 +01:00

Baggage

PkgGoDev