Reduce repeated byte-size computation in exporterhelper queueing and batching - #15277
Reduce repeated byte-size computation in exporterhelper queueing and batching#15277iblancasa wants to merge 32 commits into
Conversation
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15277 +/- ##
=======================================
Coverage 91.03% 91.04%
=======================================
Files 729 730 +1
Lines 48491 48527 +36
=======================================
+ Hits 44144 44180 +36
Misses 3020 3020
Partials 1327 1327 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance
|
jade-guiton-dd
left a comment
There was a problem hiding this comment.
Looks good. I tried finding a more elegant way to do it without passing SizerTypes everywhere but it seems this is the best we can do without a big refactor (why do we have a sizer implementation in the sizer package and another one in request??)
Yes... I spent some time trying to figure out a better way but was unable.
I think
// TODO: Move this back to queuebatch when remove the circular dependency. |
evan-bradley
left a comment
There was a problem hiding this comment.
Looks good to me. I'd like to wait a little longer for @bogdandrutu or @dmitryax to review since they're the listed code owners.
@iblancasa could you post the results of the benchmark tests on main vs. this branch? Just to make sure we're getting the speedup we're expecting.
Sure.
BenchmarkLogsRequestBytesSizeRepeated-14 13304.500n ± 3% 0 B/op 0 allocs/op
BenchmarkMetricsRequestBytesSizeRepeated-14 26987.500n ± 1% 0 B/op 0 allocs/op
BenchmarkTracesRequestBytesSizeRepeated-14 16426.500n ± 2% 0 B/op 0 allocs/op
BenchmarkProfilesRequestBytesSizeRepeated-14 8413.500n ± 1% 0 B/op 0 allocs/opThis branch: BenchmarkLogsRequestBytesSizeRepeated-14 2.660n ± 4% 0 B/op 0 allocs/op
BenchmarkMetricsRequestBytesSizeRepeated-14 2.659n ± 2% 0 B/op 0 allocs/op
BenchmarkTracesRequestBytesSizeRepeated-14 2.713n ± 1% 0 B/op 0 allocs/op
BenchmarkProfilesRequestBytesSizeRepeated-14 2.816n ± 2% 0 B/op 0 allocs/opComparison: pkg: go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch
│ main │ branch │ vs base │
LogsRequestBytesSizeRepeated-14 13304.500n 2.660n -99.98% (p=0.000 n=10)
MetricsRequestBytesSizeRepeated-14 26987.500n 2.659n -99.99% (p=0.000 n=10)
TracesRequestBytesSizeRepeated-14 16426.500n 2.713n -99.98% (p=0.000 n=10)
geomean 18.07µ 2.677n -99.99%
pkg: go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper
ProfilesRequestBytesSizeRepeated-14 8413.500n 2.816n -99.97% (p=0.000 n=10) |
|
Thanks, looks great. I'll merge this by EOD Friday (EDT) if there are no other concerns. |
dmitryax
left a comment
There was a problem hiding this comment.
Cannot see where we gain improvement
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
|
Results of the new benchmark:
BenchmarkLogsBytesQueueBatchPipeline-14 47.81µ ± 1% 704 B/op 18 allocs/op
BenchmarkMetricsBytesQueueBatchPipeline-14 96.67µ ± 1% 704 B/op 18 allocs/op
BenchmarkTracesBytesQueueBatchPipeline-14 58.27µ ± 1% 704 B/op 18 allocs/op
BenchmarkProfilesBytesQueueBatchPipeline-14 42.31µ ± 1% 704 B/op 18 allocs/opThis branch: BenchmarkLogsBytesQueueBatchPipeline-14 17.36µ ± 2% 728 B/op 18 allocs/op
BenchmarkMetricsBytesQueueBatchPipeline-14 39.07µ ± 0% 728 B/op 18 allocs/op
BenchmarkTracesBytesQueueBatchPipeline-14 21.61µ ± 1% 728 B/op 18 allocs/op
BenchmarkProfilesBytesQueueBatchPipeline-14 15.60µ ± 1% 729 B/op 18 allocs/opComparison: pkg: go.opentelemetry.io/collector/exporter/exporterhelper
│ main │ branch │ vs base │
LogsBytesQueueBatchPipeline-14 47.81µ 17.36µ -63.68% (p=0.000 n=10)
MetricsBytesQueueBatchPipeline-14 96.67µ 39.07µ -59.58% (p=0.000 n=10)
TracesBytesQueueBatchPipeline-14 58.27µ 21.61µ -62.91% (p=0.000 n=10)
geomean 64.58µ 24.48µ -62.10%
pkg: go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper
ProfilesBytesQueueBatchPipeline-14 42.31µ 15.60µ -63.13% |
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Description
Link to tracking issue
Fixes #15276
Testing