Bug 46664 - 6% Array Push and Pop Overhead in v8-deltablue
Summary: 6% Array Push and Pop Overhead in v8-deltablue
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.6
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-27 15:25 PDT by Michael Saboff
Modified: 2010-09-28 10:04 PDT (History)
3 users (show)

See Also:


Attachments
Patch to Allocate Minimal Space for Array() (2.30 KB, patch)
2010-09-27 15:36 PDT, Michael Saboff
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2010-09-27 15:25:55 PDT
The v8 benchmark component deltablue has an overhead of 6% in the array push and pop routines and descendants.
Comment 1 Michael Saboff 2010-09-27 15:36:52 PDT
Created attachment 68980 [details]
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%
Comment 2 Geoffrey Garen 2010-09-27 16:45:56 PDT
Comment on attachment 68980 [details]
Patch to Allocate Minimal Space for Array()

r=me
Comment 3 Eric Seidel (no email) 2010-09-27 18:49:12 PDT
Curious if a larger number wouldn't be better.  I assume you tested a variety of sizes?  I wonder what V8 does here.
Comment 4 WebKit Commit Bot 2010-09-27 18:52:54 PDT
Comment on attachment 68980 [details]
Patch to Allocate Minimal Space for Array()

Clearing flags on attachment: 68980

Committed r68469: <http://trac.webkit.org/changeset/68469>
Comment 5 WebKit Commit Bot 2010-09-27 18:52:58 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Michael Saboff 2010-09-28 10:04:48 PDT
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).