-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto merge of #9722 : alexcrichton/rust/less-mem, r=sanxiyn
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.
- Loading branch information
Showing
3 changed files
with
126 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters