about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-20 11:21:28 +0000
committerbors <bors@rust-lang.org>2024-01-20 11:21:28 +0000
commit227abacaef5981c2bee0fe6f087d5dbac8b84e77 (patch)
treef76e886d7b70b5b62222a9cce8e6db05b375af7b /compiler/rustc_pattern_analysis/src/lib.rs
parent314384b5fb21f3c163f2b871ddceabdd88319958 (diff)
parentc3364a23d2a0ec8557f52fcf5a705503619274c3 (diff)
downloadrust-227abacaef5981c2bee0fe6f087d5dbac8b84e77.tar.gz
rust-227abacaef5981c2bee0fe6f087d5dbac8b84e77.zip
Auto merge of #120003 - Mark-Simulacrum:opt-promoted, r=davidtwco
perf: Don't track specific live points for promoteds

We don't query this information out of the promoted (it's basically a single "unit" regardless of the complexity within it) and this saves on re-initializing the SparseIntervalMatrix's backing IndexVec with mostly empty rows for all of the leading regions in the function. Typical promoteds will only contain a few regions that need up be uplifted, while the parent function can have thousands.

For a simple function repeating println!("Hello world"); 50,000 times this reduces compile times from 90 to 15 seconds in debug mode. The previous implementations re-initialization led to an overall roughly n^2 runtime as each promoted initialized slots for ~n regions, now we scale closer to linearly (5000 hello worlds takes 1.1 seconds).

cc https://github.com/rust-lang/rust/issues/50994, https://github.com/rust-lang/rust/issues/86244
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lib.rs')
0 files changed, 0 insertions, 0 deletions