Skip to content

[connector/routing] Avoid unnecessary copy of the data #37946

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

Merged
merged 1 commit into from
Feb 15, 2025

Conversation

bogdandrutu
Copy link
Member

@bogdandrutu bogdandrutu commented Feb 14, 2025

Before:

goos: darwin
goarch: arm64
pkg: github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector/internal/plogutil
cpu: Apple M2 Max
BenchmarkMoveResourcesIfLogs-12    	  474394	      2522 ns/op	    3992 B/op	      74 allocs/op
BenchmarkMoveResourcesIfMetrics-12    	  201031	      6035 ns/op	    8408 B/op	     210 allocs/op
BenchmarkMoveResourcesIfTraces-12    	  221934	      5243 ns/op	    9112 B/op	     178 allocs/op

After:

goos: darwin
goarch: arm64
pkg: github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector/internal/plogutil
cpu: Apple M2 Max
BenchmarkMoveResourcesIfLogs-12    	  577471	      1840 ns/op	    2392 B/op	      60 allocs/op
BenchmarkMoveResourcesIfMetrics-12    	  303607	      3911 ns/op	    4824 B/op	     148 allocs/op
BenchmarkMoveResourcesIfTraces-12    	  317731	      3872 ns/op	    5208 B/op	     132 allocs/op

Copy link
Contributor

@atoulme atoulme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiles, tests pass, benchmark shows improvement - approved.

@jpkrohling jpkrohling changed the title Avoid unnecessary copy of the data in routing connector [connector/routing] Avoid unnecessary copy of the data Feb 15, 2025
@jpkrohling jpkrohling merged commit d5b09dc into open-telemetry:main Feb 15, 2025
163 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 15, 2025
@bogdandrutu bogdandrutu deleted the rm-copies-routing branch February 17, 2025 04:25
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