[Webkit-unassigned] [Bug 99118] New: JSC Should atomize constant strings before handing them to WebCore
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Oct 11 16:48:58 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=99118
Summary: JSC Should atomize constant strings before handing
them to WebCore
Product: WebKit
Version: 528+ (Nightly build)
Platform: Unspecified
OS/Version: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: eric at webkit.org
CC: ggaren at apple.com, oliver at apple.com,
barraclough at apple.com
JSC Should atomize constant strings before handing them to WebCore
The Dromaeo dom-query benchmark has the following subtest:
for ( var i = 0; i < num; i++ ) {
var elems = document.getElementsByTagName("*");
ret = elems[elems.length-1].nodeType;
}
That spends nearly 10% of total time in AtomicString hash lookups for "*". "*" is of course already in the AtomicString hash (also a global called WTF::starAtom).
I suspect that JSC may already have code to identify "*" as a constant. If it were to notice that it is a short string, and to do an AtomicString lookup for it, then it could pass WebCore an already atomized StringImpl, which would cause the AtomicString(const String&) constructor to go down the fast-path, and presumably drop 10% off this test!
I suspect variants of this may affect real world usage, but I don't know how much of a cost Atomizing constants in JSC would be on other benchmarks (or how complicated it would be). I leave those up to you JSC experts.
I have not yet tested V8 to see if they already do this.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list