about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-09-16 09:16:56 -0500
committerAlex Crichton <alex@alexcrichton.com>2017-09-16 17:09:40 -0700
commit1d088382e555101826c60571ee0670602e0abf7e (patch)
treeb10681ee70d735a1bd9b6d1dcc2cac3971ca8c4d /src/test/incremental/thinlto
parent3dbd9c5489702442831d5600c6aacd27159984d4 (diff)
parenta7817dd52cb3f830504cdf702f726a0c0b7685dd (diff)
downloadrust-1d088382e555101826c60571ee0670602e0abf7e.tar.gz
rust-1d088382e555101826c60571ee0670602e0abf7e.zip
Rollup merge of #44586 - alexcrichton:smaller-query, r=michaelwoerister
rustc: Preallocate when building the dep graph

This commit alters the `query` function in the dep graph module to preallocate
memory using `with_capacity` instead of relying on automatic growth. Discovered
in #44576 it was found that for the syntex_syntax clean incremental benchmark
the peak memory usage was found when the dep graph was being saved, particularly
the `DepGraphQuery` data structure itself. PRs like #44142 which add more
queries end up just making this much larger!

I didn't see an immediately obvious way to reduce the size of the
`DepGraphQuery` object, but it turns out that `with_capacity` helps quite a bit!
Locally 831 MB was used [before] this commit, and 770 MB is in use at the peak
of the compiler [after] this commit. That's a nice 7.5% improvement! This won't
quite make up for the losses in #44142 but I figured it's a good start.

[before]: https://gist.github.com/alexcrichton/2d2b9c7a65503761925c5a0bcfeb0d1e
[before]: https://gist.github.com/alexcrichton/6da51f2a6184bfb81694cc44f06deb5b
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions