Summary: | new Function is substantially slower than V8 | ||
---|---|---|---|
Product: | WebKit | Reporter: | Oliver Hunt <oliver> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW --- | ||
Severity: | Normal | CC: | barraclough, ggaren, sam, zwarich |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.5 | ||
URL: | http://weblogs.asp.net/yuanjian/archive/2009/03/22/json-performance-comparison-of-eval-new-function-and-json.aspx |
Description
Oliver Hunt
2009-03-31 15:35:18 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 We could eagerly build the function, but we need to weigh the costs and benefits of doing so. 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. |