Open Bug 1328858 Opened 9 years ago Updated 3 years ago

mootools $$("*") spends a lot of time in SetObjectElement

Categories

(Core :: JavaScript Engine: JIT, defect, P3)

defect

Tracking

()

People

(Reporter: evilpies, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

It seems like the biggest perfomance issue now is a missing IC for SetProp/SetElem. Especially it looks like this for me (all total time %): - SetPropertyIC::update 43% ^ SetObjectElement 37% ^ NativeSetProperty 34% ^ SetNonExistantProperty 22% So maybe we missing some IC for adding properties?
Summary: mootools $$("*") sends a lot of time in SetObjectElement → mootools $$("*") spends a lot of time in SetObjectElement
Bug 1091978 might be relevant?
Keywords: perf
Priority: -- → P3
The code is adding indexed properties to DOM objects, I don't think we support this an anywhere. var d = this.length; for (var b = 0, a = arguments.length; b < a; b++) { var c = document.id(arguments[b]); if (c) { this[d++] = c; } } return (this.length = d); |this| here is HTMLAnchorElement, HTMLElement, HTMLParagraphElement etc.
|this| is about 20 different HTML* types, so just above our IC limit, but attaching stubs would still hopefully handle 80% of the cases here. The first reason why we can't attach a stub in this case is the |addProperty| class hook on DOM objects used for preserving wrappers. Ion seems to also guard on the ArrayObject class, which should be unnecessary, because everything can have dense elements. We should look into this after converting SETELEM dense/typed array to CacheIR.
Depends on: 1337024
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.