Changeset 182878 in webkit


Ignore:
Timestamp:
Apr 15, 2015, 8:40:14 PM (11 years ago)
Author:
akling@apple.com
Message:

Make MarkedBlock and WeakBlock 4x smaller.
<https://webkit.org/b/143802>

Reviewed by Mark Hahnenberg.

To reduce GC heap fragmentation and generally use less memory, reduce the size of MarkedBlock
and its buddy WeakBlock by 4x, bringing them from 64kB+4kB to 16kB+1kB.

In a sampling of cool web sites, I'm seeing ~8% average reduction in overall GC heap size.
Some examples:

apple.com: 6.3MB -> 5.5MB (14.5% smaller)

reddit.com: 4.5MB -> 4.1MB ( 9.7% smaller)

twitter.com: 23.2MB -> 21.4MB ( 8.4% smaller)

cuteoverload.com: 24.5MB -> 23.6MB ( 3.8% smaller)

Benchmarks look mostly neutral.
Some small slowdowns on Octane, some slightly bigger speedups on Kraken and SunSpider.

  • heap/MarkedBlock.h:
  • heap/WeakBlock.h:
  • llint/LLIntData.cpp:

(JSC::LLInt::Data::performAssertions):

  • llint/LowLevelInterpreter.asm:
Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r182872 r182878  
     12015-04-15  Andreas Kling  <akling@apple.com>
     2
     3        Make MarkedBlock and WeakBlock 4x smaller.
     4        <https://webkit.org/b/143802>
     5
     6        Reviewed by Mark Hahnenberg.
     7
     8        To reduce GC heap fragmentation and generally use less memory, reduce the size of MarkedBlock
     9        and its buddy WeakBlock by 4x, bringing them from 64kB+4kB to 16kB+1kB.
     10
     11        In a sampling of cool web sites, I'm seeing ~8% average reduction in overall GC heap size.
     12        Some examples:
     13
     14                   apple.com:  6.3MB ->  5.5MB (14.5% smaller)
     15                  reddit.com:  4.5MB ->  4.1MB ( 9.7% smaller)
     16                 twitter.com: 23.2MB -> 21.4MB ( 8.4% smaller)
     17            cuteoverload.com: 24.5MB -> 23.6MB ( 3.8% smaller)
     18
     19        Benchmarks look mostly neutral.
     20        Some small slowdowns on Octane, some slightly bigger speedups on Kraken and SunSpider.
     21
     22        * heap/MarkedBlock.h:
     23        * heap/WeakBlock.h:
     24        * llint/LLIntData.cpp:
     25        (JSC::LLInt::Data::performAssertions):
     26        * llint/LowLevelInterpreter.asm:
     27
    1282015-04-15  Jordan Harband  <ljharb@gmail.com>
    229
  • trunk/Source/JavaScriptCore/heap/MarkedBlock.h

    r182747 r182878  
    7575        static const size_t atomSize = 16; // bytes
    7676        static const size_t atomShiftAmount = 4; // log_2(atomSize) FIXME: Change atomSize to 16.
    77         static const size_t blockSize = 64 * KB;
     77        static const size_t blockSize = 16 * KB;
    7878        static const size_t blockMask = ~(blockSize - 1); // blockSize must be a power of two.
    7979
  • trunk/Source/JavaScriptCore/heap/WeakBlock.h

    r182347 r182878  
    4242public:
    4343    friend class WTF::DoublyLinkedListNode<WeakBlock>;
    44     static const size_t blockSize = 4 * KB; // 5% of MarkedBlock size
     44    static const size_t blockSize = 1 * KB; // 1/16 of MarkedBlock size
    4545
    4646    struct FreeCell {
  • trunk/Source/JavaScriptCore/llint/LLIntData.cpp

    r182205 r182878  
    154154    ASSERT(ResolveModeAndType::mask == 0xffff);
    155155
    156     ASSERT(MarkedBlock::blockMask == ~static_cast<decltype(MarkedBlock::blockMask)>(0xffff));
     156    ASSERT(MarkedBlock::blockMask == ~static_cast<decltype(MarkedBlock::blockMask)>(0x3fff));
    157157
    158158    // FIXME: make these assertions less horrible.
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm

    r182759 r182878  
    197197const ResolveModeMask = 0xffff
    198198
    199 const MarkedBlockSize = 64 * 1024
     199const MarkedBlockSize = 16 * 1024
    200200const MarkedBlockMask = ~(MarkedBlockSize - 1)
    201201# Constants for checking mark bits.
Note: See TracChangeset for help on using the changeset viewer.