Closed
Bug 1848765
Opened 1 years ago
Closed 11 months ago
nsDisplayList::Sort should use nsTArray::StableSort
Categories
(Core :: Web Painting, enhancement)
Core
Web Painting
Tracking
()
RESOLVED
FIXED
126 Branch
Tracking | Status | |
---|---|---|
firefox126 | --- | fixed |
People
(Reporter: smaug, Assigned: jstutte)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sp3])
Attachments
(1 file)
Currently the method uses std::stable_sort on top of nsTArray
https://searchfox.org/mozilla-central/rev/ce049e593c7d062a039938cabccaab4c14b8ebfd/layout/painting/nsDisplayList.h#3197
That triggers ElementAt calls which do bound checks.
nsTArray::StableSort would avoid that.
https://bugzilla.mozilla.org/show_bug.cgi?id=1668200 has a similar fix for some animation code.
The ElementAt calls do show up in the profiles
Updated•1 years ago
|
See Also: → https://mozilla-hub.atlassian.net/browse/SP3-498
Updated•1 years ago
|
Component: Layout → Web Painting
Assignee | ||
Comment 1•11 months ago
|
||
FWIW, nsTArray<>::StableSort
is based on std::stable_sort
since bug 1147091.
But: nsTArray<>::StableSort
uses Elements()
to make it operate on the plain C/C++ array, which should avoid ElementsAt
. Note that std::stable_sort
may always need an additional (fallible) allocation to reach O(n*log(n))
.
Assignee | ||
Comment 2•11 months ago
|
||
Updated•11 months ago
|
Assignee: nobody → jstutte
Status: NEW → ASSIGNED
Pushed by jstutte@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cee7118d2c81
Use nsTArray<>::StableSort for nsDisplayList::Sort. r=smaug
Comment 4•11 months ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
status-firefox126:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•