]> git.lizzy.rs Git - rust.git/commit
Shrink `LiveNode`.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 22 May 2018 05:27:58 +0000 (15:27 +1000)
committerNicholas Nethercote <nnethercote@mozilla.com>
Tue, 22 May 2018 22:55:35 +0000 (08:55 +1000)
commit8d0fad5d3832c6c1f14542ea0be038274e454524
treeb7be9ffb122750e8585070ba3b0a14cd50a7a90d
parent4c26e2e3fba61f18caca8bd43c57e1f1d799f07b
Shrink `LiveNode`.

`Liveness::users` is a vector that is occasionally enormous. For
example, doing a "clean incremental" check build of `inflate`, there is
one instance that represents 5,499 live nodes and 1087 vars, which
requires 5,977,413 entries. At 24 bytes per entry, that is 143MB.

This patch changes LiveNode from a usize to a u32. On 64-bit machines
that halves the size of these entries, significantly reducing peak
memory usage and memory traffic, and speeding up "clean incremental"
builds of `inflate` by about 10%.
src/librustc/middle/liveness.rs