Bug 1038038 - Part 3: Increase ShapeTable::MIN_ENTRIES. r=bhackett, a=2.0+
authorNicholas Nethercote <nnethercote@mozilla.com>
Sun, 13 Jul 2014 23:32:45 -0700
changeset 209112 41d971477d80f77b81973b83f8ac0aaacd4e2a58
parent 209111 d94467fc9adee8f45a1b5e1cdbd127b1e2924450
child 209113 88a84442b2161b9f51193ad0ae66d13203678a04
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett, 2
bugs1038038
milestone32.0a2
Bug 1038038 - Part 3: Increase ShapeTable::MIN_ENTRIES. r=bhackett, a=2.0+ A linear search of 15 items is likely to be competitive with a hash table lookup.
js/src/vm/Shape.h
--- a/js/src/vm/Shape.h
+++ b/js/src/vm/Shape.h
@@ -120,17 +120,17 @@ static const uint32_t SHAPE_INVALID_SLOT
 static const uint32_t SHAPE_MAXIMUM_SLOT = JS_BIT(24) - 2;
 
 /*
  * Shapes use multiplicative hashing, but specialized to
  * minimize footprint.
  */
 struct ShapeTable {
     static const uint32_t HASH_BITS     = mozilla::tl::BitSize<HashNumber>::value;
-    static const uint32_t MIN_ENTRIES   = 7;
+    static const uint32_t MIN_ENTRIES   = 11;
 
     // This value is low because it's common for a ShapeTable to be created
     // with an entryCount of zero.
     static const uint32_t MIN_SIZE_LOG2 = 2;
     static const uint32_t MIN_SIZE      = JS_BIT(MIN_SIZE_LOG2);
 
     int             hashShift;          /* multiplicative hash shift */