Replace ArrayBlockingQueue with park/unpark for BatchSpanProcessor$Worker#8240
Replace ArrayBlockingQueue with park/unpark for BatchSpanProcessor$Worker#8240Khepu wants to merge 4 commits intoopen-telemetry:mainfrom
Conversation
Bypassing all the complexity that comes with ABQ should come with improved performance
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8240 +/- ##
============================================
- Coverage 90.32% 90.32% -0.01%
+ Complexity 7654 7653 -1
============================================
Files 843 843
Lines 23080 23076 -4
Branches 2312 2312
============================================
- Hits 20848 20843 -5
+ Misses 1516 1514 -2
- Partials 716 719 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Making the worker extend thread was the only sensible way of having it keep a constant reference to its thread. Everything else I tried was quite hacky
|
Thanks for the contribution! Please run the bench before/after and add results here - see #8271 on how to do it. |
|
I've been running the benchmarks and I wonder if I am doing something wrong because every one of the |
|
Which ones did you try? Benchmarks collect dust and eventually get out of date, especially the ones not regularly used. Would RecordSpanBenchmark show the changes? That's one of the few that we run on an ongoing basis and publish results to https://open-telemetry.github.io/opentelemetry-java/benchmarks/ |
|
That one I can run just fine. I have been trying to run these 2: SpanRecordBenchmark won't help here. I was trying the above 2 because all I am trying to improve is throughput of exported spans under load. The only metrics that could prove some improvement/regression here would be the number of exported and dropped spans. I will try spending some time to figure out why those metrics end up being zero on those benchmarks. |
Browsing through the codebase I saw the ArrayBlockingQueue and thought I could do something better. Running benchmarks locally did produce better results though they weren't as consistent as I would have liked.
The same changes could also be applied to
BatchLogRecordProcessor.