Optimize empty token streams - #162047
Conversation
Empty token streams are common. Every one causes an allocation for the `Arc::new()`. We can instead have a single shared empty `TokenStream` and `AttrTokenStream`.
|
@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.
Optimize empty token streams
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (11dd43e): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: missing data |
|
(Sorry, a rustc-perf failure, looking into it) |
|
@rust-timer build 11dd43e |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (11dd43e): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. @bors rollup=never rustc-perf 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.8%, secondary -0.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.6%, secondary 9.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 477.635s -> 475.679s (-0.41%) |
|
Makes sense. You can r=me. |
|
|
|
@bors r=Kobzol |
Empty token streams are common. Every one causes an allocation for the
Arc::new(). We can instead have a single shared emptyTokenStreamandAttrTokenStream.r? @Kobzol