Maybe stop searching for optimal column balancing block-size within a certain threshold
Categories
(Core :: Layout: Columns, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
Details
(Keywords: perf-alert)
Attachments
(4 files)
heycam has another idea to improve the column balancing performance. That is, we can stop searching for the optimal block-size once the difference of infeasible and feasible block-size is within a device pixel. Currently, we stop when the difference is within an app unit. [1]
This can save us a few final balancing iterations, and the slightly imperfect balance block-size shouldn't matter too much in practice.
However, we might need to fix some testcases where it's perfect balancing block-size is not divisible by device pixels like [2]
[1] https://searchfox.org/mozilla-central/rev/3d39d3b7dd1b2be30692d4541ea681614e34c786/layout/generic/nsColumnSetFrame.cpp#1046-1049
[2] https://searchfox.org/mozilla-central/rev/3d39d3b7dd1b2be30692d4541ea681614e34c786/layout/reftests/columns/column-balancing-overflow-005.html
Assignee | ||
Comment 1•5 years ago
|
||
- floats-clear-multicol-balancing-*:
Change border-width from "normal" to "5px" so that the optimal column
height is 85px. This also makes those reftests renders the same across
all browsers since each browser renders "normal" differently.
- column-balancing-overflow-005:
This test is already wrong as its height is 13px/3 = 4.3333px, so it can
pass with some fuzzy. This patch makes the target column height
4px (including the children's overflow). This is the same as the <p>
's
height 4px in reference file.
- box-decoration-break-border-image:
Add 1px to .vbreak so that the optimal column balancing height is a
integer. Also, remove a whitespace between two <span>
in <pos2>
to make the
test more robust because the width of the whitespace is not an integer.
Assignee | ||
Comment 2•5 years ago
|
||
Without setting font and line-height, these reftests may yield different
results on different platforms because of the default font are
different. Also, their optimal column balancing height may not be an
integer CSS pixels.
I discover this because they are failing due to 1px column height
difference after we stop searching optimal balancing height within a
certain threshold on either macOS, Windows, or Android.
Depends on D83729
Assignee | ||
Comment 3•5 years ago
|
||
Here's an example that can break the loop at the first iteration.
<div style="column-count:2; height:100px"><img src="" style="height:500px">
Depends on D83730
Assignee | ||
Comment 4•5 years ago
|
||
The gist of this patch is: once the feasible and infeasible block-size
is within one device pixel, we choose nextGuess to be the greatest
multiple of one device pixel below or equal to the feasible block-size.
If this nextGuess is infeasible, we will reflow children one last time
by using the last feasible block-size and done with the balancing.
Depends on D83731
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
Here's a try result with my current patches. I see 8% ~ 16% performance improvement on Wikipedia. (Type "wikipedia" into the filter text box, and choose "Show only important changes" button)
Comment 8•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/743486fcc01e
https://hg.mozilla.org/mozilla-central/rev/a6b19393adea
https://hg.mozilla.org/mozilla-central/rev/d6ce5fef610a
https://hg.mozilla.org/mozilla-central/rev/19047c90effa
Comment 10•5 years ago
|
||
== Change summary for alert #26571 (as of Wed, 22 Jul 2020 19:38:19 GMT) ==
Improvements:
10% raptor-tp6-wikipedia-firefox-cold loadtime windows10-64-shippable opt 1,893.08 -> 1,704.25
10% raptor-tp6-wikipedia-firefox-cold loadtime windows7-32-shippable opt 1,948.25 -> 1,758.50
8% raptor-tp6-wikipedia-firefox-cold loadtime windows10-64-shippable-qr opt webrender 1,823.67 -> 1,683.00
7% raptor-tp6-wikipedia-firefox-cold windows10-64-shippable opt 1,651.02 -> 1,527.99
7% raptor-tp6-wikipedia-firefox-cold windows7-32-shippable opt 1,681.69 -> 1,564.29
7% raptor-tp6-wikipedia-firefox-cold fcp windows10-64-shippable opt 1,588.83 -> 1,483.00
6% raptor-tp6-wikipedia-firefox-cold fcp windows7-32-shippable opt 1,614.42 -> 1,516.00
6% raptor-tp6-wikipedia-firefox-cold windows10-64-shippable-qr opt webrender 1,639.58 -> 1,542.67
5% raptor-tp6-wikipedia-firefox-cold fcp linux64-shippable-qr opt webrender 2,041.83 -> 1,935.33
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=26571
Description
•