DescriptionImprove performance to remove OPTIONs from a single-selection SELECT.
Manual merge from m53 to m52.
LayoutMenuList::updateOptionsHeightWidth() is an O(n) function to get maximum
OPTION width and height.
We had a bad performance because it is called whenever we remove a selected
OPTION from a SELECT. This CL changes the timing of updateOptionsHeightWidth().
Old:
It was called by updateFromElement() after an OPTION is
added/removed. updateOptionsHeightWidth() makes layout dirty only if maximum
width/height was changed.
New:
OPTION addition/removal makes maximum width/height dirty and makes layout
dirty, and updateOptionsHeightWidth() is called only if the maximum
width/height is referred.
The new behavior makes layout dirty more frequently, however it reduces the
number of updateOptionsHeightWidth() calls significantly.
This CL makes PerformanceTests/DOM/select-single-remove.html faster.
On my local machine, 5.1 runs/s -> 45.1 runs/s
Test update:
* http/tests/webfont/popup-menu-load-webfont-after-open.html
LayoutMenuList correctly updates its width and height after this CL.
* fast/repaint/control-clip.html
Extra invalidation as expected.
TBR=tkent@chromium.org
BUG=620142
Review-Url: https://codereview.chromium.org/2077343002
Cr-Commit-Position: refs/heads/master@{#400903}
(cherry picked from commit 1b32ab54ae3451e24152fc1e433b7e1cb44ac56e)
Committed: https://chromium.googlesource.com/chromium/src/+/e5e943c56399f02d9ffe9de622d38733fb956cbf
Patch Set 1 #
Messages
Total messages: 3 (1 generated)
|