<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>65437</bug_id>
          
          <creation_ts>2011-07-31 15:10:24 -0700</creation_ts>
          <short_desc>JSC GC lays out size classes under wrong assumptions about expected object size.</short_desc>
          <delta_ts>2011-08-01 02:49:27 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>65458</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Filip Pizlo">fpizlo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>oliver</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>444461</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2011-07-31 15:10:24 -0700</bug_when>
    <thetext>The typical object allocation in the GC heap is either 56 bytes (strings) or 64 bytes (objects) in 64-bit systems.  Few allocations are ever smaller than this, and it&apos;s unlikely that an allocation would ever be less than 4 words, since every JSCell has two words (vtable and structure), leaving only two words for whatever payload the object may have.  The current GC strategy lays out size classes starting at 8 bytes (the size of a double), corresponding to an impossible allocation size on 64-bit platforms and a highly unlikely one on 32-bit platforms.  This has a number of undesirable outcomes.  First, there are more mark bits in a typical MarkedBlock than necessary, leading to both wasted space and decreased locality when accessing mark bits.  Second, it means that almost identical allocation sizes (56 bytes and 64 bytes for instance) require the creation of entirely separate MarkedBlocks.  This may decrease internal fragmentation by as little (1/8th to be precise), but it will lead to higher external fragmentation: for example a string allocation will never be able to reuse space left behind by an object allocation, unless the object-sized MarkedBlock becomes entirely free, and we return it to the free block pool.  The JSC GC should probably space out size classes more widely and start with a larger size class that is more representative of the smallest common allocation size.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>444462</commentid>
    <comment_count>1</comment_count>
      <attachid>102466</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2011-07-31 15:13:51 -0700</bug_when>
    <thetext>Created attachment 102466
the patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>444463</commentid>
    <comment_count>2</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2011-07-31 15:19:24 -0700</bug_when>
    <thetext>This is a 1% win on both SunSpider and V8.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>444473</commentid>
    <comment_count>3</comment_count>
      <attachid>102466</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-07-31 16:48:43 -0700</bug_when>
    <thetext>Comment on attachment 102466
the patch

Clearing flags on attachment: 102466

Committed r92092: &lt;http://trac.webkit.org/changeset/92092&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>444474</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-07-31 16:48:47 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>102466</attachid>
            <date>2011-07-31 15:13:51 -0700</date>
            <delta_ts>2011-07-31 16:48:43 -0700</delta_ts>
            <desc>the patch</desc>
            <filename>biggersizes_patch_1.diff</filename>
            <type>text/plain</type>
            <size>1726</size>
            <attacher name="Filip Pizlo">fpizlo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gOTIwOTApCisrKyBTb3VyY2Uv
SmF2YVNjcmlwdENvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTcgQEAK
KzIwMTEtMDctMzEgIEZpbGlwIFBpemxvICA8ZnBpemxvQGFwcGxlLmNvbT4KKworICAgICAgICBK
U0MgR0MgbGF5cyBvdXQgc2l6ZSBjbGFzc2VzIHVuZGVyIHdyb25nIGFzc3VtcHRpb25zIGFib3V0
IGV4cGVjdGVkCisgICAgICAgIG9iamVjdCBzaXplLgorICAgICAgICBodHRwczovL2J1Z3Mud2Vi
a2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NjU0MzcKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JP
RFkgKE9PUFMhKS4KKyAgICAgICAgCisgICAgICAgIENoYW5nZWQgdGhlIGF0b20gc2l6ZSAtIHdo
aWNoIGlzIGJvdGggdGhlIHNtYWxsZXN0IGFsbG9jYXRpb24gc2l6ZSBhbmQKKyAgICAgICAgdGhl
IHNtYWxsZXN0IHBvc3NpYmxlIHN0ZXBwaW5nIHVuaXQgZm9yIHNpemUgY2xhc3Mgc3BhY2luZyAt
IGZyb20KKyAgICAgICAgOCBieXRlcyB0byA0IHBvaW50ZXItc2l6ZSB3b3Jkcy4gIFRoaXMgaXMg
YSAxJSB3aW4gb24gU3VuU3BpZGVyLgorCisgICAgICAgICogaGVhcC9NYXJrZWRCbG9jay5oOgor
CiAyMDExLTA3LTMxICBGaWxpcCBQaXpsbyAgP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9pZCopOwogICAgICAg
ICBzdGF0aWMgY29uc3Qgc2l6ZV90IGJsb2NrU2l6ZSA9IDE2ICogS0I7CiAKICAgICAgICAgc3Rh
dGljIGNvbnN0IHNpemVfdCBhdG9tc1BlckJsb2NrID0gYmxvY2tTaXplIC8gYXRvbVNpemU7IC8v
IH4xLjUlIG92ZXJoZWFkCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>