Bug 1267812 - Improve worst-case minor collection latency; r=jonco r=ochameau
authorTerrence Cole <terrence@mozilla.com>
Tue, 26 Apr 2016 13:53:06 -0700
changeset 296184 2d50de084439d47a51753495052eff15774b1e40
parent 296183 581279cd287e34b4af6b2544daff4589b6a2e580
child 296185 c9a8de15174801d6c77d35341916c75d994ed4e8
push id30233
push userryanvm@gmail.com
push dateThu, 05 May 2016 18:57:26 +0000
treeherdermozilla-central@0177462aac74 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco, ochameau
bugs1267812
milestone49.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 1267812 - Improve worst-case minor collection latency; r=jonco r=ochameau
devtools/server/tests/unit/test_memory_footprint.js
js/src/gc/StoreBuffer.h
--- a/devtools/server/tests/unit/test_memory_footprint.js
+++ b/devtools/server/tests/unit/test_memory_footprint.js
@@ -35,21 +35,21 @@ function init_server() {
 function add_browser_actors() {
   DebuggerServer.addBrowserActors();
   check_footprint("DebuggerServer.addBrowserActors()", 2000);
 }
 
 function connect_client() {
   gClient = new DebuggerClient(DebuggerServer.connectPipe());
   gClient.connect().then(function onConnect() {
-    check_footprint("DebuggerClient.connect()", 2000);
+    check_footprint("DebuggerClient.connect()", 2600);
   });
 }
 
 function list_tabs() {
   gClient.listTabs(function onListTabs(aResponse) {
-    check_footprint("DebuggerClient.listTabs()", 2600);
+    check_footprint("DebuggerClient.listTabs()", 3200);
   });
 }
 
 function close_client() {
   gClient.close(run_next_test);
 }
--- a/js/src/gc/StoreBuffer.h
+++ b/js/src/gc/StoreBuffer.h
@@ -32,28 +32,28 @@ class BufferableRef
   public:
     virtual void trace(JSTracer* trc) = 0;
     bool maybeInRememberedSet(const Nursery&) const { return true; }
 };
 
 typedef HashSet<void*, PointerHasher<void*, 3>, SystemAllocPolicy> EdgeSet;
 
 /* The size of a single block of store buffer storage space. */
-static const size_t LifoAllocBlockSize = 1 << 16; /* 64KiB */
+static const size_t LifoAllocBlockSize = 1 << 13; /* 8KiB */
 
 /*
  * The StoreBuffer observes all writes that occur in the system and performs
  * efficient filtering of them to derive a remembered set for nursery GC.
  */
 class StoreBuffer
 {
     friend class mozilla::ReentrancyGuard;
 
     /* The size at which a block is about to overflow. */
-    static const size_t LowAvailableThreshold = (size_t)(LifoAllocBlockSize * 1.0 / 16.0);
+    static const size_t LowAvailableThreshold = size_t(LifoAllocBlockSize / 2.0);
 
     /*
      * This buffer holds only a single type of edge. Using this buffer is more
      * efficient than the generic buffer when many writes will be to the same
      * type of edge: e.g. Value or Cell*.
      */
     template<typename T>
     struct MonoTypeBuffer
@@ -151,17 +151,18 @@ class StoreBuffer
         void clear() {
             if (!storage_)
                 return;
 
             storage_->used() ? storage_->releaseAll() : storage_->freeAll();
         }
 
         bool isAboutToOverflow() const {
-            return !storage_->isEmpty() && storage_->availableInCurrentChunk() < LowAvailableThreshold;
+            return !storage_->isEmpty() &&
+                   storage_->availableInCurrentChunk() < LowAvailableThreshold;
         }
 
         /* Trace all generic edges. */
         void trace(StoreBuffer* owner, JSTracer* trc);
 
         template <typename T>
         void put(StoreBuffer* owner, const T& t) {
             MOZ_ASSERT(storage_);