Fission MemShrink Newsletter #2

Marissa (Reese) Morris reese at mozilla.com
Mon Aug 20 22:36:22 UTC 2018


This is awesome!  Great job!

 

Marissa (Reese) Morris | Cell Phone  <tel:303-506-3282> 303-506-3282 |  <mailto:reese at mozilla.com> reese at mozilla.com | Slack: #Marissa (Reese)

 

From: firefox-dev <firefox-dev-bounces at mozilla.org> On Behalf Of Eric Rahm
Sent: Thursday, August 16, 2018 1:41 PM
To: firefox-dev <firefox-dev at mozilla.org>; dev-platform <dev-platform at lists.mozilla.org>
Subject: Fission MemShrink Newsletter #2

 

Hi Folks!

 

The Fission MemShrink project has been chugging along quite nicely and a ton of progress has been made over the past month. There's been a large focus on reducing the JS memory usage and we've managed to drop the base content JS measure <https://treeherder.mozilla.org/perf.html#/graphs?timerange=2592000&series=autoland,1684872,1,4>  by ~1.1MB (17%) [1]:

 

  <https://screenshotscdn.firefoxusercontent.com/images/c5046573-91bd-4ca1-98db-6290777e70c4.png> 

 

Additionally we've started looking at the overhead of our many threads <https://bugzilla.mozilla.org/show_bug.cgi?id=1476432>  [2], drafted up some ideas on reducing relocation overhead by adopting a fork server <https://bugzilla.mozilla.org/show_bug.cgi?id=1470591>  on linux/mac [3], and we're looking at reducing the overhead of per process font related data <https://bugzilla.mozilla.org/show_bug.cgi?id=648417>  [4].

 

Below is a sampling of the bugs that have improved memory usage over the past month, apologies if I left any off! Please feel free to point out other improvements. All numbers are per content process.

 

JS improvements

*	In a great example of every little bit counts, Kris Maglione reduced memory usage by 405KB in various bugs that made us lazily load JS content ( <https://bugzilla.mozilla.org/show_bug.cgi?id=1472491> Bug 1472491,  <https://bugzilla.mozilla.org/show_bug.cgi?id=1473631> Bug 1473631,  <https://bugzilla.mozilla.org/show_bug.cgi?id=1474139> Bug 1474139,  <https://bugzilla.mozilla.org/show_bug.cgi?id=1474155> Bug 1474155,  <https://bugzilla.mozilla.org/show_bug.cgi?id=1479241> Bug 1479241,  <https://bugzilla.mozilla.org/show_bug.cgi?id=1479245> Bug 1479245,  <https://bugzilla.mozilla.org/show_bug.cgi?id=1479309> Bug 1479309,  <https://bugzilla.mozilla.org/show_bug.cgi?id=1479310> Bug 1479310,  <https://bugzilla.mozilla.org/show_bug.cgi?id=1479312> Bug 1479312,  <https://bugzilla.mozilla.org/show_bug.cgi?id=1479313> Bug 1479313,  <https://bugzilla.mozilla.org/show_bug.cgi?id=1479318> Bug 1479318,  <https://bugzilla.mozilla.org/show_bug.cgi?id=1480319> Bug 1480319,  <https://bugzilla.mozilla.org/show_bug.cgi?id=1480327> Bug 1480327,  <https://bugzilla.mozilla.org/show_bug.cgi?id=1483363> Bug 1483363)
*	Kris also reduced memory usage by 494KB by getting rid of MessageManager globals (Bug 1480244 <https://bugzilla.mozilla.org/show_bug.cgi?id=1480244> )
*	Felipe Gomes reduced memory usage by 95KB by lazily loading JS content (Bug 1369466 <https://bugzilla.mozilla.org/show_bug.cgi?id=1369466> , Bug 1470324 <https://bugzilla.mozilla.org/show_bug.cgi?id=1470324> )
*	Mike Kaply reduced memory usage by 65KB by converting an add-on to in tree telemetry (Bug 1475571 <https://bugzilla.mozilla.org/show_bug.cgi?id=1475571> )
*	Dão Gottwald reduced memory uasge by 57KB by lazily generating thumbnails for the Ctrl+Tab panel (Bug 1481321 <https://bugzilla.mozilla.org/show_bug.cgi?id=1481321> )
*	Nick Nethercote reduced memory usage by 44KB by making mozilla::HashMaps lazily allocate their storage (Bug 1481998 <https://bugzilla.mozilla.org/show_bug.cgi?id=1481998> )
*	Benjamin Bouvier reduced memory usage by 25KB by removing SIMD.js (Bug 1416723 <https://bugzilla.mozilla.org/show_bug.cgi?id=1416723> )

Threading Overhead

*	Kris added measurements for thread stacks across platforms (Bug 1475899 <https://bugzilla.mozilla.org/show_bug.cgi?id=1475899> , Bug 1476405 <https://bugzilla.mozilla.org/show_bug.cgi?id=1476405> , Bug 1477512) <https://bugzilla.mozilla.org/show_bug.cgi?id=1477512> 
*	Kris reduced memory usage on Linux by ~3MB (that's megabytes!) by changing our default stack size (Bug 1476828 <https://bugzilla.mozilla.org/show_bug.cgi?id=1476828> )
*	Eric Rahm (this author) reduced memory usage by 50KB by reducing the amount of networking threads (Bug 1448034 <https://bugzilla.mozilla.org/show_bug.cgi?id=1448034> )
*	Xidorn Quan committed an upstream Rust patch (rust-lang/rust#52847 <https://github.com/rust-lang/rust/issues/52847> ) to fix how stack sizes are set on windows after Kris' initial investigation (Bug 1479250 <https://bugzilla.mozilla.org/show_bug.cgi?id=1479250> ) 

Font Overhead

*	The winner of biggest improvement with the smallest change goes to Lee Salzman who reduced memory usage on OSX by 10MB by reducing the skia glyph cache (Bug 1258781 <https://bugzilla.mozilla.org/show_bug.cgi?id=1258781> )

Lessons learned

 

Small fixes add up, removing dead code not only helps code quality but can save memory, adding measurements is important, caches can be easy targets. If you know of a cache we might tweak please file a bug to consider reducing it.

 

-e

 

[1] https://treeherder.mozilla.org/perf.html#/graphs?timerange=2592000 <https://treeherder.mozilla.org/perf.html#/graphs?timerange=2592000&series=autoland,1684872,1,4> &series=autoland,1684872,1,4

[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1476432

[3] https://bugzilla.mozilla.org/show_bug.cgi?id=1470591

[4] https://bugzilla.mozilla.org/show_bug.cgi?id=648417

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/firefox-dev/attachments/20180820/dce80330/attachment-0001.html>


More information about the firefox-dev mailing list