gecko-dev/startupcache
Doug Thayer a74957c6e6 Bug 1550108 - Change StartupCache format from zip to custom r=froydnj
I am not aware of anything that depends on StartupCache being a
zip file, and since I want to use lz4 compression because inflate
is showing up quite a lot in profiles, it's simplest to just use
a custom format. This loosely mimicks the ScriptPreloader code,
with a few diversions:

- Obviously the contents of the cache are compressed. I used lz4
  for this as I hit the same file size as deflate at a compression
  level of 1, which is what the StartupCache was using previously,
  while decompressing an order of magnitude faster. Seemed like
  the most conservative change to make. I think it's worth
  investigating what the impact of slower algs with higher ratios
  would be, but for right now I settled on this. We'd probably
  want to look at zstd next.
- I use streaming compression for this via lz4frame. This is not
  strictly necessary, but has the benefit of not requiring as
  much memory for large buffers, as well as giving us a built-in
  checksum, rather than relying on the much slower CRC that we
  were doing with the zip-based approach.
- I coded the serialization of the headers inline, since I had to
  jump back to add the offset and compressed size, which would
  make the nice Code(...) method for the ScriptPreloader stuff
  rather more complex. Open to cleaner solutions, but moving it
  out just felt like extra hoops for the reader to jump through
  to understand without the benefit of being more concise.

Differential Revision: https://phabricator.services.mozilla.com/D34652

--HG--
extra : moz-landing-system : lando
2019-10-04 20:44:59 +00:00
..
test Backed out 10 changesets (bug 1550108) for causing build bustages on StartupCache.cpp. 2019-09-29 01:14:31 +03:00
moz.build Bug 1554162 - Enable ESLint for startupcache/. r=froydnj 2019-05-25 02:07:26 +00:00
StartupCache.cpp Bug 1550108 - Change StartupCache format from zip to custom r=froydnj 2019-10-04 20:44:59 +00:00
StartupCache.h Bug 1550108 - Change StartupCache format from zip to custom r=froydnj 2019-10-04 20:44:59 +00:00
StartupCacheUtils.cpp Backed out 10 changesets (bug 1550108) for causing build bustages on StartupCache.cpp. 2019-09-29 01:14:31 +03:00
StartupCacheUtils.h Backed out 10 changesets (bug 1550108) for causing build bustages on StartupCache.cpp. 2019-09-29 01:14:31 +03:00