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

Fix expansion performance regression #34652

Merged
merged 1 commit into from
Jul 7, 2016

Conversation

jseyfried
Copy link
Contributor

@jseyfried jseyfried commented Jul 5, 2016

syntax-[breaking-change] cc #31645

This fixes #34630 by reverting commit 5bf7970 of PR #33943, which landed in #34424.

By removing the Rc<_> wrapping around Delimited and SequenceRepetition in TokenTree, 5bf7970 made cloning TokenTrees more expensive. While this had no measurable performance impact on the compiler's crates, it caused an order of magnitude performance regression on some macro-heavy code in the wild. I believe this is due to clones of TokenTrees in macro_parser.rs and/or macro_rules.rs.

r? @nrc

…(instead of by reference)"

This reverts commit 5bf7970.
@jseyfried
Copy link
Contributor Author

cc @Manishearth

@nrc
Copy link
Member

nrc commented Jul 5, 2016

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 5, 2016

📌 Commit 547a930 has been approved by nrc

@Manishearth
Copy link
Member

I think this should be merged now, because it is a perf regression and doesn't really change the API much.

cc @dtolnay @erickt just in case

@bors
Copy link
Contributor

bors commented Jul 6, 2016

⌛ Testing commit 547a930 with merge 70e1a95...

bors added a commit that referenced this pull request Jul 6, 2016
Fix expansion performance regression

**syntax-[breaking-change] cc #31645**

This fixes #34630 by reverting commit 5bf7970 of PR #33943, which landed in #34424.

By removing the `Rc<_>` wrapping around `Delimited` and `SequenceRepetition` in `TokenTree`, 5bf7970 made cloning `TokenTree`s more expensive. While this had no measurable performance impact on the compiler's crates, it caused an order of magnitude performance regression on some macro-heavy code in the wild. I believe this is due to clones of `TokenTree`s in `macro_parser.rs` and/or `macro_rules.rs`.

r? @nrc
@bors
Copy link
Contributor

bors commented Jul 6, 2016

💔 Test failed - auto-win-msvc-64-opt

@alexcrichton
Copy link
Member

@bors: retry

On Wed, Jul 6, 2016 at 11:13 AM, bors [email protected] wrote:

💔 Test failed - auto-win-msvc-64-opt
https://buildbot.rust-lang.org/builders/auto-win-msvc-64-opt/builds/4812


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#34652 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAD95GBhE09JcXrWEux_Bm7saxw1X0GBks5qS_BegaJpZM4JEsjv
.

@bors
Copy link
Contributor

bors commented Jul 7, 2016

⌛ Testing commit 547a930 with merge de78655...

bors added a commit that referenced this pull request Jul 7, 2016
Fix expansion performance regression

**syntax-[breaking-change] cc #31645**

This fixes #34630 by reverting commit 5bf7970 of PR #33943, which landed in #34424.

By removing the `Rc<_>` wrapping around `Delimited` and `SequenceRepetition` in `TokenTree`, 5bf7970 made cloning `TokenTree`s more expensive. While this had no measurable performance impact on the compiler's crates, it caused an order of magnitude performance regression on some macro-heavy code in the wild. I believe this is due to clones of `TokenTree`s in `macro_parser.rs` and/or `macro_rules.rs`.

r? @nrc
@bors bors merged commit 547a930 into rust-lang:master Jul 7, 2016
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

Successfully merging this pull request may close these issues.

Nightly Compile Time Regression (06/23 to 07/01)
5 participants