Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary copy while decoding and constructing string #37734

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

bogdandrutu
Copy link
Member

@bogdandrutu bogdandrutu commented Feb 6, 2025

Before (including copy of the bytes needed upstream):

goos: darwin
goarch: arm64
pkg: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/reader
cpu: Apple M2 Max
BenchmarkFileRead
BenchmarkFileRead-12    	    6890	    159408 ns/op	  125802 B/op	     132 allocs/op
PASS

After

goos: darwin
goarch: arm64
pkg: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/reader
cpu: Apple M2 Max
BenchmarkFileRead
BenchmarkFileRead-12    	    7662	    154923 ns/op	  121656 B/op	     130 allocs/op
PASS

@open-telemetry open-telemetry deleted a comment from sfc-gh-bdrutu Feb 6, 2025
@atoulme

This comment was marked as resolved.

@bogdandrutu bogdandrutu force-pushed the rm-unncessary-copy branch 2 times, most recently from c40b78d to 4450e14 Compare February 6, 2025 23:07
@bogdandrutu bogdandrutu merged commit 4244166 into open-telemetry:main Feb 7, 2025
162 of 163 checks passed
@bogdandrutu bogdandrutu deleted the rm-unncessary-copy branch February 7, 2025 01:57
@github-actions github-actions bot added this to the next release milestone Feb 7, 2025
chengchuanpeng pushed a commit to chengchuanpeng/opentelemetry-collector-contrib that referenced this pull request Feb 8, 2025
…telemetry#37734)

Before (including copy of the bytes needed upstream):
```
goos: darwin
goarch: arm64
pkg: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/reader
cpu: Apple M2 Max
BenchmarkFileRead
BenchmarkFileRead-12    	    6890	    159408 ns/op	  125802 B/op	     132 allocs/op
PASS
```

After
```
goos: darwin
goarch: arm64
pkg: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/reader
cpu: Apple M2 Max
BenchmarkFileRead
BenchmarkFileRead-12    	    7662	    154923 ns/op	  121656 B/op	     130 allocs/op
PASS
```

Signed-off-by: Bogdan Drutu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants