Cameron McCormack <c...@mcc.id.au> writes: > Kan-Ru Chen (陳侃如): >> The two things we most want to know while profiling Firefox OS app >> launch time are (1) what styles had been changed (2) why did the restyle >> take so long. >> >> Gaia apps are designed around event dispatches and one event could >> trigger many style changes from anywhere from the code base. It is hard >> to know what styles had been changed, for example class added or >> removed, and what rules had actually been matched. This leads to the >> second question. From the gecko profile we usually find both the >> selector matching and style recalc take considerable amount of time. So >> I guess we could start from reducing the expensive selectors then trying >> to reduce the matched elements. Without knowing which rules had actually >> been matched, we don't know how to optimize the CSS rules. >> >> So, do you know a way to collect this kind of information, preferably >> from WebIDE? > > I don’t know whether any of this information is surfaced in WebIDE; I’ll > let someone else answer that. But we could build interfaces to expose > this information, if it’s not already exposed.
Thanks for the very detailed answer! So in other words, we could do the following: (1) Collect the elements that have styles changed by comparing the rule node or style context. We could report them to devtools and maybe also list the changed style for each of them. (2) Record DOM manipulations and the restyle hints they generated via a specific selector. Then count the element traversed while doing selector matching. Also count the number of new style context resolved. We can then sort the report by these numbers. Does this make sense? Kanru _______________________________________________ dev-tech-layout mailing list dev-tech-layout@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-layout