-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't miss cache for orthogonal flow ancestor on subsequent layout.
If a node has already been laid out at least once in the current lifecycle update, there's no need to miss the layout cache just because there's an orthogonal writing mode root somewhere in there, since the engine has had an opportunity to update things based on the new containing block size. For flex layout, missing the cache every time caused problematic performance complexity (didn't check, but possibly O(2^n), 'n' being the nesting level). The performance test included is about 25000 times faster than before, from about 0.065 runs per second, to about 1600 times per second (when testing locally). Bug: 1472660 Change-Id: I5c5c813c745d75ebcd5d6d82a1b96354c64bc502 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4793751 Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/main@{#1185431}
- Loading branch information
Showing
5 changed files
with
79 additions
and
12 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
third_party/blink/perf_tests/layout/flexbox-deeply-nested-with-ortho-flow.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
body { | ||
overflow: scroll; | ||
} | ||
iframe { | ||
display: block; | ||
} | ||
</style> | ||
<script src="../resources/runner.js"></script> | ||
<iframe id="target" xsrc="resources/flexbox-deeply-nested-with-ortho-flow-as-iframe.html"> | ||
</iframe> | ||
<pre id="log"></pre> | ||
<script> | ||
var target = document.getElementById("target"); | ||
var style = target.style; | ||
|
||
var parent = target.contentDocument.body; | ||
for (var i = 0; i < 20; i++) { | ||
var div = target.contentDocument.createElement("div"); | ||
div.style.display = "flex"; | ||
parent.appendChild(div); | ||
parent = div; | ||
} | ||
var div = target.contentDocument.createElement("div"); | ||
div.style.writingMode = "vertical-rl"; | ||
div.id = "ortho"; | ||
parent.appendChild(div); | ||
parent = div; | ||
var text = target.contentDocument.createTextNode("It went sideways"); | ||
parent.appendChild(text); | ||
|
||
function test() { | ||
style.height = "200px"; | ||
target.contentDocument.documentElement.offsetTop; | ||
style.height = "190px"; | ||
target.contentDocument.documentElement.offsetTop; | ||
} | ||
|
||
onload = function() { | ||
PerfTestRunner.measureRunsPerSecond({ | ||
description: "Orthogonal flow root inside deeply nested flex, change initial containing block size", | ||
run: test | ||
}); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters