nsBulletFrame::Ordinal is slow
Categories
(Core :: Layout, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr60 | --- | unaffected |
firefox67 | --- | unaffected |
firefox67.0.1 | --- | unaffected |
firefox68 | --- | verified |
firefox69 | --- | verified |
People
(Reporter: heycam, Assigned: emilio)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: perf, regression)
Attachments
(4 files)
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
jcristau
:
approval-mozilla-beta+
|
Details |
(deleted),
text/x-phabricator-request
|
jcristau
:
approval-mozilla-beta+
|
Details |
(deleted),
text/x-phabricator-request
|
jcristau
:
approval-mozilla-beta+
|
Details |
Since switching to the new bullet implementation, I see a lot of time spent under nsBulletFrame::Ordinal.
For example:
-
Loading https://en.wikipedia.org/wiki/Barack_Obama on my desktop, we spend 203 ms / 3089 ms = 6.6% of page load time in there: https://perfht.ml/2W6b5F1
-
Loading https://html.spec.whatwg.org/ on my desktop, we spend 1625 ms / 10328 ms = 15.7% of page load time in there: https://perfht.ml/2WcvUP6
Assignee | ||
Comment 1•5 years ago
|
||
Do you know if we spend more time than before on the frame sorting code? I'm surprised that it being such a massive part of page load time according to your profiles it wasn't detected as a perf regression by Talos.
Assignee | ||
Comment 2•5 years ago
|
||
We should probably just stash the counter value on the bullet frame here, and make nsBulletFrame::Ordinal() O(1) again.
I think that if the marker uses content
then that should already be handled by the SetText() call. Wdyt mats? I'm happy to write a patch for that.
Comment 3•5 years ago
|
||
Sounds good to me. Could you also remove the aDebugFromA11y param
we added in bug 1539656 too then? (essentially just revert that
patch modulo the #ifdef ACCESSIBILITY it added)
Assignee | ||
Comment 5•5 years ago
|
||
Assignee | ||
Comment 6•5 years ago
|
||
Now without broken stuff under it: https://treeherder.mozilla.org/#/jobs?repo=try&revision=89d7a6ce62d6b4c59824c7c13f39ee7bab00a876
Comment 7•5 years ago
|
||
[Triaging as a p3 regression from bug 205202, w/ status flags set accordingly. If any of my adjustments are wrong, apologies & please correct.]
Comment 8•5 years ago
|
||
(er, I'll bet this is more specifically a regression from bug 288704 " Make nsBulletFrame use the built-in 'list-item' CSS counter and remove the old implementation")
Assignee | ||
Comment 9•5 years ago
|
||
Err, the orange in that try run is because I forgot to update an assertion... Other than that it looks green, except for the nested pseudo-element case that my own test caught (dammit ;)).
I think there's some counters code assuming that nested pseudos don't exist. I haven't dug yet.
Assignee | ||
Comment 10•5 years ago
|
||
Assignee | ||
Comment 11•5 years ago
|
||
I thought I was going to need it but turns out I don't. Still this is worth it I
think.
Assignee | ||
Comment 12•5 years ago
|
||
I'm going to need it to fix the counters code in presence of nested
pseudo-elements.
Depends on D31987
Assignee | ||
Comment 13•5 years ago
|
||
When you have a ::after::marker, and you compare one against the other we ended
up with the wrong result because of the pseudotype stuff.
I think this is cleaner now that DoCompareTreePosition handles pseudos properly
(which is really the thing this was working around).
Depends on D31988
Assignee | ||
Comment 14•5 years ago
|
||
I did this instead of just (ab)using the fact that every list item has at least
one counter-increment node because:
-
I don't have the bullet frame around by the time we initially compute the
counter increment, which means that I'd need to grow nsBlockFrame / add a
frame property for the list item ordinal, which I think would be unfortunate. -
It feels more consistent with the way regular CSS counters work and with the
way we want ::marker to eventually work.
Depends on D31989
Comment 15•5 years ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d008903b2ace Do some cleanup in the counter initializer code. r=mats https://hg.mozilla.org/integration/autoland/rev/e7dcf2a302c5 Make nsLayoutUtils::DoCompareTreePosition handle pseudos more diligently. r=mats https://hg.mozilla.org/integration/autoland/rev/209e8a6ae29d Make nsGenConList::NodeAfter handle correctly nested pseudo-elements. r=mats https://hg.mozilla.org/integration/autoland/rev/1a44a048e2f0 Make nsBulletFrame::Ordinal() O(1) again. r=mats
Comment 16•5 years ago
|
||
Pushed by emilio@crisal.io: https://hg.mozilla.org/integration/autoland/rev/f023603f7e72 Bump an assertion count in the XBL + lists test, since we run the code that asserts more often now. r=bustage
Assignee | ||
Updated•5 years ago
|
Comment 17•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d008903b2ace
https://hg.mozilla.org/mozilla-central/rev/e7dcf2a302c5
https://hg.mozilla.org/mozilla-central/rev/209e8a6ae29d
https://hg.mozilla.org/mozilla-central/rev/1a44a048e2f0
https://hg.mozilla.org/mozilla-central/rev/f023603f7e72
Reporter | ||
Updated•5 years ago
|
Assignee | ||
Comment 18•5 years ago
|
||
Comment on attachment 9066373 [details]
Bug 1552719 - Make nsBulletFrame::Ordinal() O(1) again. r=mats
Beta/Release Uplift Approval Request
- User impact if declined: Perf regression.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: See bug 1544951 comment 0.
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Relatively straight-forward patches, plus that part of the code is pretty well covered by automated tests.
- String changes made/needed: none
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 19•5 years ago
|
||
Hi Guys, I managed to reproduce this issue in Firefox 68.0b3 and there's a definite improvement in Firefox 69 but the blank page is still displayed for a bit while on Chrome its almost non existent. Can I mark this as Verified is the half a second of a blank page acceptable or it should be similar to Chrome ?
Assignee | ||
Comment 20•5 years ago
|
||
You should see whether Firefox 69 performs ~similar to Firefox 67. Firefox 68 should be slower than that because of the issue this patches fix.
Comment 21•5 years ago
|
||
Unfortunately no, Firefox 67 loads the page instantly, compared to that there's a visible difference, but compared to 68 its slightly improved.
Assignee | ||
Comment 22•5 years ago
|
||
So you're saying that 67 is much faster than 68, and still a bit faster than 69?
Comment 23•5 years ago
|
||
Please disregard my previous comment, I have downloaded the latest Nightly from https://tools.taskcluster.net/index/gecko.v2.mozilla-central.latest.firefox/win64-opt and the page loads Instantly, I will mark this issue accordingly.
Assignee | ||
Comment 24•5 years ago
|
||
Nice :)
Comment 25•5 years ago
|
||
Comment on attachment 9066371 [details]
Bug 1552719 - Make nsLayoutUtils::DoCompareTreePosition handle pseudos more diligently. r=mats,mattwoodrow
perf regression in 68, approved for 68.0b4
Updated•5 years ago
|
Updated•5 years ago
|
Comment 26•5 years ago
|
||
bugherder uplift |
Comment 27•5 years ago
|
||
Hi, This issue is verified as fixed in our latest Beta 68.0b7. I will mark this issue accordingly.
Updated•2 years ago
|
Updated•2 years ago
|
Description
•