Bug 1455221 - Part 3: Increase size of table used by perfect hash function from 256 to 512. r=nika
authorJorg K <jorgk@jorgk.com>
Fri, 20 Apr 2018 10:13:00 +0300
changeset 414905 ca83c0b3a19d3735988a3ebe245ce50272e16e59
parent 414904 6c972ac2e177134c905af399cac7397d4f33932e
child 414906 616ab4435c153f87ab87463e1afb7a75e44e1fad
push id33879
push userapavel@mozilla.com
push dateSat, 21 Apr 2018 09:32:13 +0000
treeherdermozilla-central@dd0e54d78674 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1455221
milestone61.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 1455221 - Part 3: Increase size of table used by perfect hash function from 256 to 512. r=nika
xpcom/reflect/xptinfo/xptcodegen.py
xpcom/reflect/xptinfo/xptinfo.cpp
xpcom/reflect/xptinfo/xptinfo.h
--- a/xpcom/reflect/xptinfo/xptcodegen.py
+++ b/xpcom/reflect/xptinfo/xptcodegen.py
@@ -9,19 +9,19 @@
 # reference to them.
 
 import json
 from perfecthash import PerfectHash
 import time
 from collections import OrderedDict
 
 # We fix the number of entries in our intermediate table used by the perfect
-# hashes to 256. This number is constant in xptinfo, allowing the compiler to
+# hashes to 512. This number is constant in xptinfo, allowing the compiler to
 # generate a more efficient modulo due to it being a power of 2.
-PHFSIZE = 256
+PHFSIZE = 512
 
 def indented(s):
     return s.replace('\n', '\n  ')
 
 def cpp(v):
     if type(v) == bool:
         return "true" if v else "false"
     return str(v)
--- a/xpcom/reflect/xptinfo/xptinfo.cpp
+++ b/xpcom/reflect/xptinfo/xptinfo.cpp
@@ -36,17 +36,17 @@ static uint16_t
 Phf_DoLookup(const void* aBytes, uint32_t aLen, const uint32_t* aIntr)
 {
   uint32_t mid = aIntr[Phf_DoHash(aBytes, aLen) % kPHFSize];
   if (mid & U32_HIGH_BIT) {
     return mid & ~U32_HIGH_BIT;
   }
   return Phf_DoHash(aBytes, aLen, mid) % sInterfacesSize;
 }
-static_assert(kPHFSize == 256, "wrong phf size?");
+static_assert(kPHFSize == 512, "wrong phf size?");
 
 
 ////////////////////////////////////////
 // PHF-based interface lookup methods //
 ////////////////////////////////////////
 
 /* static */ const nsXPTInterfaceInfo*
 nsXPTInterfaceInfo::ByIID(const nsIID& aIID)
--- a/xpcom/reflect/xptinfo/xptinfo.h
+++ b/xpcom/reflect/xptinfo/xptinfo.h
@@ -505,17 +505,17 @@ extern const nsXPTDOMObjectInfo sDOMObje
 
 extern const char sStrings[];
 extern const ConstInfo sConsts[];
 
 // shim constant information
 extern const mozilla::dom::NativePropertyHooks* sPropHooks[];
 
 // Perfect Hash Function backing data
-static const uint16_t kPHFSize = 256;
+static const uint16_t kPHFSize = 512;
 extern const uint32_t sPHF_IIDs[]; // Length == kPHFSize
 extern const uint32_t sPHF_Names[]; // Length == kPHFSize
 extern const uint16_t sPHF_NamesIdxs[]; // Length == sInterfacesSize
 
 
 //////////////////////////////////////
 // Helper Methods for fetching data //
 //////////////////////////////////////