diff options
| author | bors <bors@rust-lang.org> | 2021-08-06 12:11:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-08-06 12:11:30 +0000 |
| commit | 4c29cc8fd09889880880cb6081174c79744ab1b6 (patch) | |
| tree | 505b3df889d18b1a959b38315d7833d6f10a7754 /compiler/rustc_codegen_gcc/src/base.rs | |
| parent | 1f94abcda6884893d4723304102089198caa0839 (diff) | |
| parent | 1c21373b50f39269f553e736933c70841f419d2e (diff) | |
| download | rust-4c29cc8fd09889880880cb6081174c79744ab1b6.tar.gz rust-4c29cc8fd09889880880cb6081174c79744ab1b6.zip | |
Auto merge of #87777 - the8472:fix-mir-max-rss, r=oli-obk,joshtriplett
Use zeroed allocations in the mir interpreter instead eagerly touching the memory #86255 introduced a 30% regression in [page faults](https://perf.rust-lang.org/compare.html?start=64ae15ddd3f3cca7036ab2b2f3a6b130b62af4da&end=39e20f1ae5f13451eb35247808d6a2527cb7d060&stat=faults ) and a 3% regression in [max-rss](https://perf.rust-lang.org/index.html?start=2021-07-01&end=&absolute=false&stat=max-rss) in the ctfe-stress benchmarks. That's most likely happened because it separated allocation from initialization of the vec which defeats the zero-optimization. Currently there's no allocation API that is fallible, zeroing and returns a slice, so this PR introduces one and then uses that to solve the problem. In principle `vec.resize(len, 0)` could be optimized to use `alloc::grow_zeroed` where appropriate but that would require new specializations and new plumbing in `RawVec`.
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/base.rs')
0 files changed, 0 insertions, 0 deletions
