-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
macros: improve expansion performance #37569
Conversation
The |
@Manishearth r=me |
📌 Commit e652060 has been approved by |
`Token::Interpolated(Nonterminal)` -> `Token::Interpolated(Rc<Nonterminal>)`.
This reverts commit 41745f3.
e652060
to
91c778a
Compare
91c778a
to
b7eed53
Compare
Since not needing ast coercion is a feature, it should have tests so that it is not broken by this improvement. Are there any tests? I didn't find any in the tree. |
great! I overlooked compile-fail. |
@bors r=eddyb |
📌 Commit 51104e5 has been approved by |
…=eddyb macros: improve expansion performance This PR fixes that regression, further improves performance on recursive, `tt`-heavy workloads, and makes a variety of other improvements to parsing and expansion performance. Expansion performance improvements: | Test case | Run-time | Memory usage | | -------------- | -------- | ------------ | | libsyntax | 8% | 10% | | librustc | 15% | 6% | | librustc_trans | 30% | 6% | | rust-lang#37074 | 20% | 15% | | rust-lang#34630 | 40% | 8% | r? @eddyb
…=eddyb macros: improve expansion performance This PR fixes that regression, further improves performance on recursive, `tt`-heavy workloads, and makes a variety of other improvements to parsing and expansion performance. Expansion performance improvements: | Test case | Run-time | Memory usage | | -------------- | -------- | ------------ | | libsyntax | 8% | 10% | | librustc | 15% | 6% | | librustc_trans | 30% | 6% | | rust-lang#37074 | 20% | 15% | | rust-lang#34630 | 40% | 8% | r? @eddyb
AFAICT this PR regressed the speed of html5ever compilation in rustc-benchmarks. perf.rust-lang.org is showing a 6% regression for html5ever this week while other benchmarks are basically unchanged. This PR is one of the PRs that show up in the regressing measurement, and I have profiling data that corroborates. One cause of this is the I think these are not the only parts of the change that lead to regressions, but it's less obvious from my profiling what else might be a factor, other than vec and slice operations are showing up higher in the profile. (I got that from the Cachegrind output.) |
@nnethercote Thanks, I'll fix the regression ASAP. |
…fried Macro parser performance improvements and refactoring This PR locally increased performance of #37074 by ~6.6 minutes. Follow up to #37569, but doesn't focus explicitly on expansion performance. History is relatively clean, but I can/will do some more polishing if this is deemed mergeable. Partially posting this now so I can get Travis to run tests for me. r? @jseyfried
#34908 regressed expansion performance on recursive,
tt
-heavy workloads.This PR fixes that regression, further improves performance on recursive,
tt
-heavy workloads, and makes a variety of other improvements to parsing and expansion performance.Expansion performance improvements:
r? @eddyb