[bmalloc] IsoHeap shared tier threshold is small
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Jun 2019 18:49:09 +0000 (18:49 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Jun 2019 18:49:09 +0000 (18:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=199145

Reviewed by Saam Barati.

We accidentally picked 3 for the shared tier threshold. While this is OK because the important part of IsoHeap shared tier is putting
small # of shared objects before tiering up to the page-based allocation, increasing this threshold can potentially improve memory footprint.
This patch increases this threshold from 3 to 8. A/B test says that this offers stable 0.25% improvement in PLUM2.

* bmalloc/IsoHeapImpl.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246744 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/bmalloc/ChangeLog
Source/bmalloc/bmalloc/IsoHeapImpl.h

index 9b203e9..7993b71 100644 (file)
@@ -1,3 +1,16 @@
+2019-06-24  Yusuke Suzuki  <ysuzuki@apple.com>
+
+        [bmalloc] IsoHeap shared tier threshold is small
+        https://bugs.webkit.org/show_bug.cgi?id=199145
+
+        Reviewed by Saam Barati.
+
+        We accidentally picked 3 for the shared tier threshold. While this is OK because the important part of IsoHeap shared tier is putting
+        small # of shared objects before tiering up to the page-based allocation, increasing this threshold can potentially improve memory footprint.
+        This patch increases this threshold from 3 to 8. A/B test says that this offers stable 0.25% improvement in PLUM2.
+
+        * bmalloc/IsoHeapImpl.h:
+
 2019-06-21  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [bmalloc] IsoTLS Layout extension initializes one IsoTLSEntry twice
index 228fa54..86b8b77 100644 (file)
@@ -39,7 +39,7 @@ class BEXPORT IsoHeapImplBase {
     MAKE_BMALLOCED;
 public:
     static constexpr unsigned maxAllocationFromShared = 8;
-    static constexpr unsigned maxAllocationFromSharedMask = maxAllocationFromShared - 1;
+    static constexpr unsigned maxAllocationFromSharedMask = (1U << maxAllocationFromShared) - 1U;
     static_assert(maxAllocationFromShared <= bmalloc::alignment, "");
     static_assert(isPowerOfTwo(maxAllocationFromShared), "");