Bug 816656 - Don't write the startup cache on shutdown. r=taras
☠☠ backed out by f2ce0bb43518 ☠ ☠
authorBenoit Girard <b56girard@gmail.com>
Mon, 03 Dec 2012 13:10:11 -0500
changeset 114797 bc20093cfc9d0b2e932ebc4f74b0b37d20f732a4
parent 114796 9d0e73213774fb54426f1cdd98daaa6cada967e8
child 114798 1273cc549e2edc8c857837fc8268af9166e9a8ec
push id18984
push userb56girard@gmail.com
push dateMon, 03 Dec 2012 18:10:37 +0000
treeherdermozilla-inbound@bc20093cfc9d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstaras
bugs816656
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 816656 - Don't write the startup cache on shutdown. r=taras The startup cache will be saved in the background ~10 seconds after startup. If 10 seconds haven't elapsed yet don't bother write the cache on shutdown.
startupcache/StartupCache.cpp
--- a/startupcache/StartupCache.cpp
+++ b/startupcache/StartupCache.cpp
@@ -134,17 +134,19 @@ StartupCache::~StartupCache()
   if (mTimer) {
     mTimer->Cancel();
   }
 
   // Generally, the in-memory table should be empty here,
   // but an early shutdown means either mTimer didn't run 
   // or the write thread is still running.
   WaitOnWriteThread();
-  WriteToDisk();
+  // If we shutdown quickly timer wont have fired. Instead of writing
+  // it on the main thread and block the shutdown we simply wont update
+  // the startup cache.
   gStartupCache = nullptr;
   (void)::NS_UnregisterMemoryReporter(mMappingMemoryReporter);
   (void)::NS_UnregisterMemoryReporter(mDataMemoryReporter);
   mMappingMemoryReporter = nullptr;
   mDataMemoryReporter = nullptr;
 }
 
 nsresult