Low Level Tools/2018Q3
From MozillaWiki
Nick
Planned
rustc: Fix up and enable the MIR inlining pass.
- 0% completed.
rustc: land three changes that noticeably speed up compilation of one or more notable programs with non-lexical lifetimes enabled.
- 100%+ completed
- Sped up NLL on the five slowest NLL benchmarks by 55%, 21%, 16%, 10% and 9%, and reduced max-rss of three benchmarks by 53%, 33%, and 9%.
- Sped up NLL by 60% on ucd.
- Sped up NLL by 33% html5ever, 1% on some other benchmarks.
- Sped up NLL on ucd by 25%.
- Sped up NLL by up to 2%.
- Sped up NLL by up to 1.5%.
- Sped up NLL on keccak and inflate by 1%.
- Sped up NLL by up to 1%.
- Sped up NLL on ripgrep by 0.5%.
- Reduced NLL peak memory by 27% for keccak and 8% for inflate.
- Reduced NLL peak memory by 14--45% on four rustc-perf benchmarks, and 96% on one external crate!
- Reduced instruction counts on several by up to 16%, and max-rss by up to 38%; some of the benefit goes to NLL builds.
- Reduced NLL peak memory by 20% on keccak.
Analyze two Rust-in-Firefox compilation workloads that Mozilla engineers complain about, to see where future Rust compilation speed efforts should focus.
- 50% completed.
- I analyzed Xidorn's scenario (touch stylist.rs and recompile).
- I found sccache and incremental compilation interacted poorly, potentially slowing down this scenario by over 1 minute. Ted fixed this and released a new sccache version (0.2.7).
- I identified that lld is 2--3x faster than the default linkers.
- I communicated all this to dev-platform.
Unplanned
Hash table improvements:
- Added hash table microbenchmarks that showed js::Hash{Map,Set} are much faster than PLDHashTable, and that fxhash makes Rust hash tables much faster.
- Moved js::Hash{Set,Map} into MFBT so it could be used everywhere in Firefox, because it's faster than the Gecko hash tables *and* has a nicer API.
- Made mozilla::Hash{Map,Set}'s entry storage allocation lazy, making its API nicer, removing ~900 LOC, and saving 45 KiB per content process.
- Inlined PLDHashTable::SearchTable(). Successful lookups are about 1.13x faster, failing lookups are about 1.54x faster, and insertions/removals are about 1.05x faster.
- Converted CCGraph::mPtrToNodeMap to a mozilla::HashSet. Speeds up cycle collection by up to 7% in some cases. mccr8 said "this is one of the largest improvements to CC throughput (ie rather than pause time) since Olli's skippable work many years ago."
- Converted the prefs table from PLDHashTable to mozilla::HashTable.
- A bunch of other minor mozilla::Hash{Map,Set} API and docs improvements in various other bugs.
DocShell/SessionHistory refactoring
- I completed a bunch of bugs cleaning up this code to help with Project Fission.