-
Notifications
You must be signed in to change notification settings - Fork 765
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
tracing-subscriber's Directive parsing adds 600us to startup time #3174
Comments
For rustup this amounts to about 14% of the total time of |
14% of |
@davidbarsky I don't understand. It seemed to me that slowdown was entirely due to time it takes to compile regex for parsing |
I'm trying to say until we get rid of the regex in |
It would have been nice if there was a filter which could be configured using |
Yeah, we should have a let rust_log = std::env::var("RUST_LOG")?;
let filter = rust_log.parse::<filter::Targets>()?;
// setup the rest of subscriber... |
Bug Report
I was debugging/optimizing startup time of a cli tool I'm working on, and I've noticed
that:
takes around 600us on my machine. Yes, I'm using
--release
. It seems to me that lazy-compiling the regex used to parse the directives is where the time is spent, because changing to.parse("")
is almost instant, and adding a lot of other directives does not seem to change much either.600us is not all that much, but when we're talking about "blazingly fast" it kind of adds up (another part that I'm looking at is
clap
, bringing the minimum startup time of my CLI to 1.5ms area in debug builds, and 800us in release builds).Version
tracing v0.1.41
tracing-subscriber v0.3.19
Platform
The text was updated successfully, but these errors were encountered: