-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Non linear runtime increasment for expand_crate
pass while compiling diesel with 128-column-tables
#81262
Comments
Are you able to reproduce this on the nightly compiler? I'm wondering if #78317 addressed this problem. Edit: nevermind. It seems that only addressed the |
It might be helpful to have a minimal example to reproduce the issue. |
@est31 That would be something like https://github.com/weiznich/minimal_example_for_rust_81262 |
@weiznich thanks, that looks great already! |
There have been a bunch of performance improvements for macro expansion, so I've decided to check whether the issue still exists, first with a nightly adjacent to the filing of this bug, and then a recent one. I used commands like
Apparently, speed did improve! But the strong nonlinearity still remains. Note that I'm testing end-to-end compilation speeds here, I don't know how much of a component expanding is. fundamentally macro matching is quadratic with the number of rules, but an increase of macro rules seems not to be happening here. The macro is only used to invoke something different a lot of times, so all that increases is the number of times that a macro gets executed. cc @nnethercote who is way more familiar with macro expansion code than me. |
FTR it's been replaced by a proc macro but apparently speed wise it's not any better. |
Ignoring the internals of macro matching for a moment:
The growth in lines is slower than the growth in compile times, so there may be non-linear stuff happening internally. This might be in |
My guess is that some non-linearity is caused by this macro. That one is internally called by |
This is a followup issue to rust-lang/rustc-perf#807, where I've suggested to add
diesel
with the128-column-tables
enabled to the rustc-perf test-suite as this is taking quite a lot of time to compile. As part of that request we discovered that theexpand_crate
pass scales non-linear with the number of codelines expanded through a macro. (For diesel that would likely be this macro call which expands the macro above for all tuples sizes between 1 and the maximal number specified (16, 32, 64 or 128) via this macro@rustbot modify labels: +I-slow
The text was updated successfully, but these errors were encountered: