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

Improve Clone performance by 5-7x #1998

Merged
merged 2 commits into from
Oct 22, 2020

Conversation

bogdandrutu
Copy link
Member

Before:

BenchmarkLogsClone-16    	    2022	    526826 ns/op
BenchmarkMetricsClone-16    	      92	  11530154 ns/op
BenchmarkTracesClone-16    	     237	   4822875 ns/op

After:

BenchmarkLogsClone-16    	   17643	     70484 ns/op
BenchmarkMetricsClone-16    	     516	   2226758 ns/op
BenchmarkTracesClone-16    	    1286	    853794 ns/op

Signed-off-by: Bogdan Drutu bogdandrutu@gmail.com

Before:
```
BenchmarkLogsClone-16    	    2022	    526826 ns/op
BenchmarkMetricsClone-16    	      92	  11530154 ns/op
BenchmarkTracesClone-16    	     237	   4822875 ns/op
```

After:
```
BenchmarkLogsClone-16    	   17643	     70484 ns/op
BenchmarkMetricsClone-16    	     516	   2226758 ns/op
BenchmarkTracesClone-16    	    1286	    853794 ns/op
```

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
@bogdandrutu bogdandrutu requested a review from a team October 22, 2020 17:58
Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

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

Nice. I guess Protobuf's Clone uses reflection.

Important: do we have tests that verify that CopyTo is actually cloning and does not forget and keep some references?

@bogdandrutu
Copy link
Member Author

The tests that I added for clone fill all the fields, and verify all of them are "copied".

In terms of reference, we do use same references to the immutable objects.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
@codecov
Copy link

codecov bot commented Oct 22, 2020

Codecov Report

Merging #1998 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1998      +/-   ##
==========================================
- Coverage   91.49%   91.49%   -0.01%     
==========================================
  Files         282      282              
  Lines       16631    16628       -3     
==========================================
- Hits        15217    15214       -3     
  Misses        978      978              
  Partials      436      436              
Impacted Files Coverage Δ
consumer/pdata/common.go 96.73% <100.00%> (+0.02%) ⬆️
consumer/pdata/log.go 100.00% <100.00%> (ø)
consumer/pdata/metric.go 99.25% <100.00%> (-0.02%) ⬇️
consumer/pdata/trace.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96a4455...8be28d0. Read the comment docs.

@bogdandrutu bogdandrutu merged commit b5093ab into open-telemetry:master Oct 22, 2020
@bogdandrutu bogdandrutu deleted the improveclone branch October 22, 2020 18:59
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this pull request Jul 5, 2024
…_client`, and make it contains all symbols needed. (open-telemetry#2005)

Fix open-telemetry#1998

Delegate all API calls of gRPC into `opentelemetry_exporter_otlp_grpc_client`, and make it contains all symbols needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants