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 bc20093cfc9d
parent 114796 9d0e73213774
child 114798 1273cc549e2e
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