Bug 1524688: Part 64 - Reduce component manager allocations. r=froydnj
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 16:55:45 -0800
changeset 459035 81dc12cc9257
parent 459034 c7c49f64048f
child 459036 95fd39d659bc
push id111909
push usermaglione.k@gmail.com
push dateThu, 14 Feb 2019 02:30:40 +0000
treeherdermozilla-inbound@81dc12cc9257 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1524688
milestone67.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 1524688: Part 64 - Reduce component manager allocations. r=froydnj With most of the JS components converted to static registration, the string arena and component hashtables are much smaller than the minimum space we allocate for them. Differential Revision: https://phabricator.services.mozilla.com/D18474
xpcom/components/nsComponentManager.cpp
xpcom/components/nsComponentManager.h
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -333,17 +333,17 @@ nsresult nsComponentManagerImpl::Create(
 
   if (!gComponentManager) {
     return NS_ERROR_FAILURE;
   }
 
   return gComponentManager->QueryInterface(aIID, aResult);
 }
 
-static const int CONTRACTID_HASHTABLE_INITIAL_LENGTH = 128;
+static const int CONTRACTID_HASHTABLE_INITIAL_LENGTH = 32;
 
 nsComponentManagerImpl::nsComponentManagerImpl()
     : mFactories(CONTRACTID_HASHTABLE_INITIAL_LENGTH),
       mContractIDs(CONTRACTID_HASHTABLE_INITIAL_LENGTH),
       mLock("nsComponentManagerImpl.mLock"),
       mStatus(NOT_INITIALIZED) {}
 
 static nsTArray<const mozilla::Module*>* sExtraStaticModules;
--- a/xpcom/components/nsComponentManager.h
+++ b/xpcom/components/nsComponentManager.h
@@ -264,17 +264,17 @@ class nsComponentManagerImpl final : pub
   // Shutdown
   enum {
     NOT_INITIALIZED,
     NORMAL,
     SHUTDOWN_IN_PROGRESS,
     SHUTDOWN_COMPLETE
   } mStatus;
 
-  mozilla::ArenaAllocator<1024 * 8, 8> mArena;
+  mozilla::ArenaAllocator<1024 * 1, 8> mArena;
 
   struct PendingServiceInfo {
     const nsCID* cid;
     PRThread* thread;
   };
 
   inline PendingServiceInfo* AddPendingService(const nsCID& aServiceCID,
                                                PRThread* aThread);