]> git.lizzy.rs Git - rust.git/commit
Auto merge of #34652 - jseyfried:fix_expansion_perf, r=nrc
authorbors <bors@rust-lang.org>
Thu, 7 Jul 2016 03:04:11 +0000 (20:04 -0700)
committerGitHub <noreply@github.com>
Thu, 7 Jul 2016 03:04:11 +0000 (20:04 -0700)
commitde78655bca47cac8e783dbb563e7e5c25c1fae40
tree1e74a08a79b8d12f5166600f3ca19c449d7732ad
parent5c674a11471ec0569f616854d715941757a48a0a
parent547a930835be262ebea5e499dba7555a8a47b992
Auto merge of #34652 - jseyfried:fix_expansion_perf, r=nrc

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
src/libsyntax/ext/expand.rs
src/libsyntax/ext/tt/transcribe.rs
src/libsyntax/parse/parser.rs