about summary refs log tree commit diff
path: root/src/test/codegen/stack-alloc-string-slice.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-10-04 15:04:11 -0700
committerAlex Crichton <alex@alexcrichton.com>2013-10-04 17:41:15 -0700
commit1996a11bb29b61802d18830ba1eabdf4f99582ae (patch)
treef283b2749d0f31613920ce842edb1b3eb8339f18 /src/test/codegen/stack-alloc-string-slice.rs
parent8cb3426f16e22215f9a8dd61bb8b965fb9b26023 (diff)
downloadrust-1996a11bb29b61802d18830ba1eabdf4f99582ae.tar.gz
rust-1996a11bb29b61802d18830ba1eabdf4f99582ae.zip
Cache more results of const_eval
According to http://huonw.github.io/isrustfastyet/mem/#012f909, the "const
marking" pass generates about 400MB of extra memory during compilation. It
appears that this is due to two different factors:

    1. There is a `ccache` map in the ty::ctxt which is only ever used in this
       pass, so this commit moves the map out of the ty::ctxt struct and into
       just this pass's visitor. This turned out to not benefit that much in
       memory (as indicated by http://i.imgur.com/Eo4iOzK.png), but it's helpful
       to do nonetheless.

    2. During const_eval, there are a lot of lookups into decoding inlined items
       from external crates. There is no caching involved here, so the same
       static or variant could be re-translated many times. After adding
       separate caches for variants and statics, the memory peak of compiling
       rustc decreased by 200MB (as evident by http://i.imgur.com/ULAUMtq.png)

The culmination of this is basically a slight reorganization of a caching map
for the const_eval pass along with a 200MB decrease in peak memory usage when
compiling librustc.
Diffstat (limited to 'src/test/codegen/stack-alloc-string-slice.rs')
0 files changed, 0 insertions, 0 deletions