-
Notifications
You must be signed in to change notification settings - Fork 741
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
Exponential compile times with chained #[instrument] #1399
Comments
Out of interest, what Rust compiler version are you using? There was a regression introduced in |
Your hunch is correct! This is on 1.52, and with 1.49 the issue goes away. |
In fact, it goes bad on nightly-2020-12-19, the same version as your linked issue. |
Adding boxing as a workaround helps! |
Great, glad I could help! I'm going to close this since it's an upstream bug and, as far as I know, there isn't anything |
No problem! |
Bug Report
Version
Platform
Linux 5.11.0-16-generic / Ubuntu 21.04 / x86_64
Crates
Probably
tracing-attributes
Description
cargo build
takes exponential time in the number of#[instrument]
s chained after each other on async functions.Using
#[instrument(err)]
makes the problem worse.In our rust codebase at Cognite, we found that adding just a few
#[instrument(err)]
statements increased compile times drastically. After some investigation, I found the cause to be exponential behavior in the number of such statements. This is demonstrated in this github repository:https://github.com/audunska/tracing-exponential
Plotting the excess average compile time in seconds vs. the number of
#[instrument]
s (note the logarithmic y axis):The text was updated successfully, but these errors were encountered: