-
Notifications
You must be signed in to change notification settings - Fork 452
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
feature: refactor and extend log_exporter
benchmark
#2143
feature: refactor and extend log_exporter
benchmark
#2143
Conversation
21785fd
to
6468e84
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2143 +/- ##
=====================================
Coverage 79.0% 79.0%
=====================================
Files 121 121
Lines 20945 20945
=====================================
Hits 16561 16561
Misses 4384 4384 ☔ View full report in Codecov by Sentry. |
This commit refactors and extends the `log_exporter` benchmark. 1. Rename to be more precise: `FooWithFuture` becomes `FooAsyncTrait`, `FooWithoutFuture` becomes `FooSync` 2. Add variant using native Rust support for async traits 3. Share workload code between implementations 4. Use blackbox hint for implementations under test 5. Expand module documentation 6. Move each impl into its own submodule
6468e84
to
abbd9f5
Compare
@demurgos Thanks in advance for your patience! I am clearing my backlog and will get to this soon! |
pub struct NoOpExporterAsyncNative; | ||
|
||
impl LogExporterAsyncNative for NoOpExporterAsyncNative { | ||
#[inline] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add this consistently to other ones too, to ensure a fair comparison.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I missed the #[inline]
, I thought I applied it everywhere. I'll update my PR.
use super::*; | ||
|
||
/// Async style using Rustc support for async traits | ||
pub trait LogExporterAsyncNative: Send + Sync + Debug { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the benchmarks, this looks to be close enough with sync counterpart. Wondering if there is a reason we can't try this in the Exporter traits? The <T>
for output might make things complex...?
(I only added this benchmarks to see if there is actually some price to be paid for introducing async.)
@demurgos Do you have some bandwidth to modify existing exporter trait to use async native style? The existing benchmarks should show improvement with this change, based on what i observe in this PR.
(Still pretty new to Rust async, so I might be missing something obvious!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey 👋
I was also interested in trying to impl a version using native async. I'm pretty familiar with it, but the lib is pretty large. I'll try to send something, but I can't promise any timeline.
@lalitb Can you help continue this? |
Had a quick look. The Before going forward, it's good to discuss if we should bump-up our msrv to 1.75 for otel-sdk, and all exporters. |
Closing this, as we have a PR already open to make this happen : #2374 |
Design discussion issue: #2031
Changes
This commit refactors and extends the
log_exporter
benchmark.FooWithFuture
becomesFooAsyncTrait
,FooWithoutFuture
becomesFooSync
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes: N/A