Closed
Bug 875815
Opened 11 years ago
Closed 5 months ago
Terrible performance on mootools $$("*") call
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: bzbarsky, Unassigned)
References
(Depends on 1 open bug)
Details
Looking at http://dromaeo.com/?id=195568,195582 and in particular at the "DOM Query (Mootools)" section the first item is "Mootools - *". On this item we're 10x slower than Chrome, though on the other items we're pretty similar, mostly. A profile shows that it's all a mess. Specifically: 1) 14% of the time is spent taking the slow fallback path through ion::GetPropertyIC::update. I'm not quite sure why, though at least part of this seems to be calling HTMLFormElement resolve hooks or something? And more is nativeLoookup. 2) 17% of the time is self time in js::Interpret(!). The interpreter is also calling a bunch of ion::CanEnter, TypeMonitorResult, proxy_GetElement (which lands in HTMLCollectionBinding, doing an own-prop get), etc, etc. The total fraction of time under js::Interpret but not under JITs is about 31% (!!). 3) About 18% of the time is self time in baseline jitcode. 4) 6% js::ion::ProxyGet calling into HTMLCollectionBinding. 5) 6% js::ion:DoGetNameFallback calling into js::GetScopeName (which is 3% of total time). 6) Various DoTypeUpdateFallback and DoTypeMonitorFallback being called from baseline jitcode, afaict, is another 6-7%. I guess the most important question to start with is why we're spending so much of our time in baseline, and worse yet in interp....
Reporter | ||
Comment 1•11 years ago
|
||
Some more data. $$ looks like this: if (arguments.length == 1 && typeof selector == 'string') return this.document.getElements(selector); (that's the path we should end up taking every time through it) and then the only other weird part in the function is: var args = Array.flatten(arguments); Not sure whether this prevents ion-compilation of $$ itself. getElements looks like this: getElements: function(tags, nocash){ tags = tags.split(','); var elements = []; var ddup = (tags.length > 1); tags.each(function(tag){ var partial = this.getElementsByTagName(tag.trim()); (ddup) ? elements.extend(partial) : elements = partial; }, this); return new Elements(elements, {ddup: ddup, cash: !nocash}); } In this case this should end up doing a single call to getElementsByTagName and then call the |new Elements| thing. Then there's a bunch of stuff that happend in the initialize() function in Elements, including walking the list with [i], etc... Not sure which parts of this are ending up in interp, exactly and why.
Depends on: 649887
Comment 2•11 years ago
|
||
All of that code should compile with both Ion and Baseline.
Updated•11 years ago
|
Assignee: general → kvijayan
Comment 3•10 years ago
|
||
Testing Firefox 34 x Chrome 39: http://dromaeo.com/?id=232094,232093 Mootools - * 314.03runs/s ±73.30% 1188.82runs/s ±3.18% Firefox still almost 4x slower.
Reporter | ||
Comment 4•7 years ago
|
||
We should probably retest now that bug 1323190 is fixed.
Depends on: 1323190
Flags: needinfo?(evilpies)
Comment 5•7 years ago
|
||
Bug 965992 also blocks a mootools bug, so we might want to wait for that to land as well.
Comment 6•7 years ago
|
||
Mootools - * is still pretty slow: 432.44runs/s with just the IC from bug 1323190 and 491.11runs/s when using my local Proxy::get inlining patch.
Flags: needinfo?(evilpies)
Updated•3 years ago
|
Assignee: kvijayan → nobody
Updated•2 years ago
|
Severity: normal → S3
Comment 7•5 months ago
|
||
We're still slower; 4500 vs 6500. But we're not nearly at 10x, and mootools is fading away AIUI.
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•