Bug 24967 - new Function is substantially slower than V8
Summary: new Function is substantially slower than V8
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL: http://weblogs.asp.net/yuanjian/archi...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-31 15:35 PDT by Oliver Hunt
Modified: 2012-09-07 12:46 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2009-03-31 15:35:18 PDT
The linked site shows that performance of eval and new Function are dramatically slower (in the order of 2x slower) than eval and new Function in other browsers.  We should investigate why this is the case.
Comment 1 Oliver Hunt 2009-09-30 16:05:57 PDT
new Function (at least) results in a double parse -- eg.
new Function(string)

is considered

function /*foo*/ (..) {
   string
}

which parses the function statement, but does not generate an AST for `string` as it is inside the function statement
Comment 2 Sam Weinig 2009-09-30 16:08:16 PDT
We could eagerly build the function, but we need to weigh the costs and benefits of doing so.
Comment 3 Gavin Barraclough 2012-09-07 12:46:32 PDT
Retested JSC performance for eval/new Function is 67/389, V8 performance is 82/84, Firefox performance is 71/456.

We're faster than firefox, and only slower now on new Function.  Updating title accordingly.