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

tracing-subscriber's Directive parsing adds 600us to startup time #3174

Open
dpc opened this issue Dec 9, 2024 · 0 comments
Open

tracing-subscriber's Directive parsing adds 600us to startup time #3174

dpc opened this issue Dec 9, 2024 · 0 comments

Comments

@dpc
Copy link
Contributor

dpc commented Dec 9, 2024

Bug Report

I was debugging/optimizing startup time of a cli tool I'm working on, and I've noticed
that:

EnvFilter::builder().with_regex(false).parse("debug")

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

Linux ren 6.12.0-rc6 #1-NixOS SMP PREEMPT_DYNAMIC Tue Jan  1 00:00:00 UTC 1980 x86_64 GNU/Linux
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

No branches or pull requests

1 participant