perf(compilation): Directly construct Take and Chain#156680
perf(compilation): Directly construct Take and Chain#156680bushrat011899 wants to merge 1 commit into
Take and Chain#156680Conversation
Moving `Take` and `Chain` from `std::io` into `core::io` required setting up constructors for use in `std`. These constructors increased compilation time in `image` by 1.4% due to increased time spent in LTO. Switching to unstable public fields for consturction instead.
|
r? @scottmcm rustbot has assigned @scottmcm. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@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.
…try> perf(compilation): Directly construct `Take` and `Chain`
|
I'm leaving libs reviews. |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (d6321e3): comparison URL. Overall result: ❌✅ regressions and improvements - 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 countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -3.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.8%, secondary 3.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 510.693s -> 511.061s (0.07%) |
|
Very interesting, the performance results imply the regression in compilation time comes from the methods which were not modified by my PR, only moved from |
Objective
Performance regression in compilation discovered found here was narrowed down to the movement of utility types from
std::iotocore::iohere. Likely culprit is the introduction ofcore::io::takeandcore::io::chainto constructionTakeandChainwithinRead::takeandRead::chain. If this does not address the compilation difference, then it must be the unchanged methods which are not#[inline], such asChain::into_inner, etc.Have not replicated the compilation performance difference locally, happy to amend/delete this PR if a perf-run shows it has no effect.,
Notes