remove TokenStream from the bridge#151830
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
remove `TokenStream` from the bridge
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (a1f3eec): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 2.6%, secondary -4.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 0.7%, secondary -10.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 1.0%, secondary -0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 474.117s -> 476.858s (0.58%) |
This comment has been minimized.
This comment has been minimized.
|
@jieyouxu can you start another perf run? |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
remove `TokenStream` from the bridge
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (31b33e0): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.0%, secondary 1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 21.5%, secondary 31513.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 1.5%, secondary 1.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 474.712s -> 475.37s (0.14%) |
279a45f to
0090eed
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
remove `TokenStream` from the bridge
78eacaa to
7c750ba
Compare
This comment has been minimized.
This comment has been minimized.
7c750ba to
4aa97f0
Compare
4aa97f0 to
ef7a6df
Compare
|
@bors try |
This comment has been minimized.
This comment has been minimized.
remove `TokenStream` from the bridge
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🎉 Experiment
Footnotes
|
|
one minimization: use proc_macro::TokenStream;
#[proc_macro]
pub fn identity(input: TokenStream) -> TokenStream {
input
}and macro_rules! operator_impl {
($target_expr:expr) => {
x::identity! {
$target_expr as fn()
};
};
}
fn main() {
operator_impl!(|| ());
}caused by the fact that with this change, |
add test for closure precedence in `TokenStream`s A test for a regression found by the rust-lang#151830 crater run in several different crates.
|
☔ The latest upstream changes (presumably #155339) made this pull request unmergeable. Please resolve the merge conflicts. |
View all comments
This PR replaces the handle-based management of
TokenStreams inproc_macrowith a new type that is just aRc<Vec<TokenTree>>. This type is very similar to the currentTokenStreamtypes in rustc and rust-analyzer, which are roughlyArc<Vec<TokenTree>>. This comes with some gains and drawbacks:Improvements
proc_macro::bridgecan be removed.TokenStreamoperations are faster now since they do not need to use RPC anymore. This should be especially helpful for r-a.token-stream-stresstest is much faster now, which is hopefully representative for large proc macros.proc_macrousable in regular crates (Tracking issue forproc_macroin non-proc-macrocrates #130856).Regressions
TokenStreamnow has a worseDisplayimplementation now that adds whitespace between most tokens. This is is theory allowed by the documentation of this implementation:but might still cause too much breakage to be acceptable. This needs a crater run.
clap_deriveandserde_deriveare higher now. This is somewhat expected since LLVM can now understand what aTokenStreamreally is and perform some optimizations based on that.related: #101419