1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-28 21:09:17 +02:00
opentelemetry-go/trace
ttoad 86df763d90
trace: Span in noop.Start is no longer allocated (#5457)
trace/noop/noop.Span should be instance. This will reduce memory waste.

Benchmark results

with changes:
new.txt
```
goos: darwin
goarch: arm64
pkg: go.opentelemetry.io/otel/trace/noop
BenchmarkNoopInstance-10        29894822                39.94 ns/op           48 B/op          1 allocs/op
BenchmarkNoopInstance-10        29675424                39.99 ns/op           48 B/op          1 allocs/op
BenchmarkNoopInstance-10        30064700                39.98 ns/op           48 B/op          1 allocs/op
BenchmarkNoopInstance-10        29962016                40.03 ns/op           48 B/op          1 allocs/op
BenchmarkNoopInstance-10        30060465                40.02 ns/op           48 B/op          1 allocs/op
BenchmarkNoopInstance-10        29916855                40.04 ns/op           48 B/op          1 allocs/op
BenchmarkNoopInstance-10        29829998                40.28 ns/op           48 B/op          1 allocs/op
BenchmarkNoopInstance-10        30084706                39.99 ns/op           48 B/op          1 allocs/op
BenchmarkNoopInstance-10        30087441                40.02 ns/op           48 B/op          1 allocs/op
BenchmarkNoopInstance-10        29864365                40.14 ns/op           48 B/op          1 allocs/op
```
without changes on `main`:
old.txt
```
goos: darwin
goarch: arm64
pkg: go.opentelemetry.io/otel/trace/noop
BenchmarkNoopInstance-10        14813442                67.64 ns/op          128 B/op          2 allocs/op
BenchmarkNoopInstance-10        17714486                68.17 ns/op          128 B/op          2 allocs/op
BenchmarkNoopInstance-10        17701257                67.66 ns/op          128 B/op          2 allocs/op
BenchmarkNoopInstance-10        17805859                67.69 ns/op          128 B/op          2 allocs/op
BenchmarkNoopInstance-10        17912841                67.43 ns/op          128 B/op          2 allocs/op
BenchmarkNoopInstance-10        17864120                67.58 ns/op          128 B/op          2 allocs/op
BenchmarkNoopInstance-10        17663130                68.41 ns/op          128 B/op          2 allocs/op
BenchmarkNoopInstance-10        17740423                67.57 ns/op          128 B/op          2 allocs/op
BenchmarkNoopInstance-10        17751040                67.56 ns/op          128 B/op          2 allocs/op
BenchmarkNoopInstance-10        17738064                67.91 ns/op          128 B/op          2 allocs/op

```

benchstat: 
```
goos: darwin
goarch: arm64
pkg: go.opentelemetry.io/otel/trace/noop
                │   old.txt   │               new.txt               │
                │   sec/op    │   sec/op     vs base                │
NoopInstance-10   67.65n ± 1%   40.02n ± 0%  -40.84% (p=0.000 n=10)

                │   old.txt   │              new.txt               │
                │    B/op     │    B/op     vs base                │
NoopInstance-10   128.00 ± 0%   48.00 ± 0%  -62.50% (p=0.000 n=10)

                │  old.txt   │              new.txt               │
                │ allocs/op  │ allocs/op   vs base                │
NoopInstance-10   2.000 ± 0%   1.000 ± 0%  -50.00% (p=0.000 n=10)
```

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-06-04 11:14:10 -07:00
..
embedded Add READMEs to every package (#5103) 2024-03-26 20:13:54 +01:00
noop trace: Span in noop.Start is no longer allocated (#5457) 2024-06-04 11:14:10 -07:00
config_test.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
config.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
context_test.go trace: SpanFromContext and SpanContextFromContext make no allocs (#5049) 2024-03-12 08:39:28 +01:00
context.go trace: SpanFromContext and SpanContextFromContext make no allocs (#5049) 2024-03-12 08:39:28 +01:00
doc.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
go.mod Release v1.27.0/v0.49.0/v0.3.0 (#5392) 2024-05-21 10:59:36 -07:00
go.sum dependabot updates Sun Mar 3 18:37:17 UTC 2024 (#5026) 2024-03-03 22:08:09 +01:00
nonrecording.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
noop_test.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
noop.go trace: Add Span.AddLink method (#5032) 2024-03-28 08:35:15 +01:00
README.md Add READMEs to every package (#5103) 2024-03-26 20:13:54 +01:00
trace_test.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
trace.go trace: Add Span.AddLink method (#5032) 2024-03-28 08:35:15 +01:00
tracestate_benchkmark_test.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
tracestate_test.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
tracestate.go [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00

Trace API

PkgGoDev