New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shrink `LiveNode`. #50981

Merged
merged 1 commit into from May 24, 2018

Conversation

Projects
None yet
5 participants
@nnethercote
Contributor

nnethercote commented May 22, 2018

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%.

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%.
@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented May 22, 2018

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@nikomatsakis

This comment has been minimized.

Contributor

nikomatsakis commented May 23, 2018

@nnethercote really we ought to remove the liveness code altogether, and reimplement the pass to operate over the MIR (and probably using datafrog)

UPDATE: filed #51003

@nikomatsakis

This comment has been minimized.

Contributor

nikomatsakis commented May 23, 2018

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented May 23, 2018

📌 Commit 8d0fad5 has been approved by nikomatsakis

@eddyb

This comment has been minimized.

Member

eddyb commented May 23, 2018

This is the old bloated inflate, right? I feel like we should make that more explicit - people actually using the crate today won't see anything, the piles of code liveness (and presumably borrowck too) chokes on, are gone.

kennytm added a commit to kennytm/rust that referenced this pull request May 24, 2018

Rollup merge of rust-lang#50981 - nnethercote:shrink-LiveNode, r=niko…
…matsakis

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%.

bors added a commit that referenced this pull request May 24, 2018

Auto merge of #51023 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

Successful merges:

 - #50864 (Add NetBSD/arm target specs)
 - #50956 (rust-gdb: work around the re-used -d argument in cgdb)
 - #50964 (Make sure that queries have predictable symbol names.)
 - #50965 (Update LLVM to pull in another wasm fix)
 - #50972 (Add -Z no-parallel-llvm flag)
 - #50979 (Fix span for type-only arguments)
 - #50981 (Shrink `LiveNode`.)
 - #50995 (move type out of unsafe block)
 - #51011 ( rustdoc: hide macro export statements from docs)

Failed merges:

@bors bors merged commit 8d0fad5 into rust-lang:master May 24, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@nnethercote nnethercote deleted the nnethercote:shrink-LiveNode branch May 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment