<?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>46664</bug_id>
          
          <creation_ts>2010-09-27 15:25:55 -0700</creation_ts>
          <short_desc>6% Array Push and Pop Overhead in v8-deltablue</short_desc>
          <delta_ts>2010-09-28 10:04:48 -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>OS X 10.6</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Saboff">msaboff</reporter>
          <assigned_to name="Michael Saboff">msaboff</assigned_to>
          <cc>ager</cc>
    
    <cc>commit-queue</cc>
    
    <cc>eric</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>285799</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2010-09-27 15:25:55 -0700</bug_when>
    <thetext>The v8 benchmark component deltablue has an overhead of 6% in the array push and pop routines and descendants.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>285811</commentid>
    <comment_count>1</comment_count>
      <attachid>68980</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2010-09-27 15:36:52 -0700</bug_when>
    <thetext>Created attachment 68980
Patch to Allocate Minimal Space for Array()

Changes the JSArray() constructor that takes an ArgList argument to allocate space for three elements when the ArgList is empty.

This improves v8-deltablue by about 2.8%</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>285888</commentid>
    <comment_count>2</comment_count>
      <attachid>68980</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2010-09-27 16:45:56 -0700</bug_when>
    <thetext>Comment on attachment 68980
Patch to Allocate Minimal Space for Array()

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>285989</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-09-27 18:49:12 -0700</bug_when>
    <thetext>Curious if a larger number wouldn&apos;t be better.  I assume you tested a variety of sizes?  I wonder what V8 does here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>285991</commentid>
    <comment_count>4</comment_count>
      <attachid>68980</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-09-27 18:52:54 -0700</bug_when>
    <thetext>Comment on attachment 68980
Patch to Allocate Minimal Space for Array()

Clearing flags on attachment: 68980

Committed r68469: &lt;http://trac.webkit.org/changeset/68469&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>285992</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-09-27 18:52:58 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>286319</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2010-09-28 10:04:48 -0700</bug_when>
    <thetext>In response to comment from eric@webkit.org, I tried values of 1 through 4.  It appears that there is a knee at 3 as it was better than the other values. I suspect that the initialization overhead hurts as the value goes higher (the JSValue() constructor is called for each allocated element).</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>68980</attachid>
            <date>2010-09-27 15:36:52 -0700</date>
            <delta_ts>2010-09-27 18:52:54 -0700</delta_ts>
            <desc>Patch to Allocate Minimal Space for Array()</desc>
            <filename>46664.patch</filename>
            <type>text/plain</type>
            <size>2359</size>
            <attacher name="Michael Saboff">msaboff</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBKYXZhU2NyaXB0
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDY4NDI5KQorKysgSmF2YVNjcmlwdENvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTYgQEAKKzIwMTAtMDktMjcgIE1pY2hhZWwg
U2Fib2ZmICA8bXNhYm9mZkBhcHBsZS5jb20+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZ
IChPT1BTISkuCisKKyAgICAgICAgQ2hhbmdlZCB0aGUgaW5pdGlhbGl6YXRpb24gb2YgSlNBcnJh
eSBvYmplY3RzIHRvIGhhdmUgc3BhY2UgZm9yIAorICAgICAgICAzIGVsZW1lbnRzIGZvciB0aGUg
Y29uc3RydWN0b3IgdGhhdCB0YWtlcyBhIEFyZ0xpc3QgYXJndW1lbnQuCisgICAgICAgIFRoaXMg
aW1wcm92ZXMgdjgtZGVsdGFibHVlIHBlcmZvcm1hbmNlIGJ5IGFib3V0IDIuOCUgYnkgcmVkdWNp
bmcgCisgICAgICAgIHRoZSBudW1iZXIgb2YgcmVhbGxvYygpIGNhbGxzLgorICAgICAgICBodHRw
czovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NDY2NjQKKworICAgICAgICAqIHJ1
bnRpbWUvSlNBcnJheS5jcHA6CisgICAgICAgIChKU0M6OkpTQXJyYXk6OkpTQXJyYXkpOgorCiAy
MDEwLTA5LTI3ICBBbmRlcnMgQ2FybHNzb24gIDxhbmRlcnNjYUBhcHBs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