Bug 927705 (part 2b) - Never overload pldhash past 75% full, because performance plummets near the end. r=jorendorff.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 21 Oct 2013 15:44:01 -0700
changeset 151596 8f8cacbb1b6a5a292c31d8fa2b69613fb9ab8e18
parent 151595 1a02bec165e16f370cace3da21bb2b377a0a7242
child 151597 2be5e3682c98a58d28304c32b08ecfa831c39b17
push id35237
push usernnethercote@mozilla.com
push dateTue, 22 Oct 2013 05:13:33 +0000
treeherdermozilla-inbound@2be5e3682c98 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs927705
milestone27.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 927705 (part 2b) - Never overload pldhash past 75% full, because performance plummets near the end. r=jorendorff.
xpcom/glue/pldhash.cpp
--- a/xpcom/glue/pldhash.cpp
+++ b/xpcom/glue/pldhash.cpp
@@ -564,22 +564,18 @@ PL_DHashTableOperate(PLDHashTable *table
             if (table->removedCount >= size >> 2) {
                 METER(table->stats.compresses++);
                 deltaLog2 = 0;
             } else {
                 METER(table->stats.grows++);
                 deltaLog2 = 1;
             }
 
-            /*
-             * Grow or compress table, returning null if ChangeTable fails and
-             * falling through might claim the last free entry.
-             */
-            if (!ChangeTable(table, deltaLog2) &&
-                table->entryCount + table->removedCount == size - 1) {
+            /* Grow or compress table, returning null if ChangeTable fails. */
+            if (!ChangeTable(table, deltaLog2)) {
                 METER(table->stats.addFailures++);
                 entry = nullptr;
                 break;
             }
         }
 
         /*
          * Look for entry after possibly growing, so we don't have to add it,