Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Issue 16629006: Revert 151996 "Avoid N^2 walk placing renderers when building th..." (Closed)

Created:
7 years, 6 months ago by eseidel
Modified:
7 years, 6 months ago
CC:
blink-reviews, hinoka
Visibility:
Public.

Description

Revert 151996 "Avoid N^2 walk placing renderers when building th..." > Avoid N^2 walk placing renderers when building the render tree > > Blink resolves style by walking each element from first children to last, but > when we go to insert their renderer, we look for the next renderer to insert > before. On the initial style resolve, this means we'll walk the entire DOM > tree trying to find the right renderer to insert before leading to an N^2 > loop over the DOM on load. > > This could be fixed by changing the semantics by which we insert renderers > (insert after instead of insert before). Instead, here I reverse the order > we resolve style. This should ensure that in the common case, we'll find > the renderer to insert before immediately. > > While looking at this, I also found we have an N^2 loop for resolving > Nth last child selectors, and reversing the style resolve loop would have > caused the same issue for Nth child selectors. To fix prevent this regression, > I'm piping the child index down to the style resolver in the common case. > This ensures both Nth and Nth last should usually be O(1). > > Using the microbenchmark created for lazy layout, > http://elliottsprehn.com/personal/lazyblock/, this yields a speedup of > nearly 50% (4.75s -> 2.51s). > > BUG=245478 > > Review URL: https://chromiumcodereview.appspot.com/15871005 TBR=leviw@chromium.org

Patch Set 1 #

Patch Set 2 : Updated revert which should compile #

Patch Set 3 : Update to head #

Unified diffs Side-by-side diffs Delta from patch set Stats (+57 lines, -150 lines) Patch
M LayoutTests/fast/dom/HTMLLinkElement/resolve-url-on-insertion-expected.txt View 1 1 chunk +2 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/cache/subresource-expiration-1-expected.txt View 1 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/http/tests/cache/subresource-expiration-2-expected.txt View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/SelectorChecker.h View 1 3 chunks +1 line, -3 lines 0 comments Download
M Source/core/css/SelectorChecker.cpp View 1 2 chunks +2 lines, -4 lines 0 comments Download
M Source/core/css/SiblingTraversalStrategies.h View 1 2 chunks +9 lines, -14 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.h View 1 2 chunks +2 lines, -8 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 2 7 chunks +10 lines, -10 lines 0 comments Download
M Source/core/css/resolver/StyleResolverState.h View 1 4 chunks +1 line, -4 lines 0 comments Download
M Source/core/css/resolver/StyleResolverState.cpp View 1 2 chunks +1 line, -3 lines 0 comments Download
M Source/core/dom/ContainerNode.h View 1 2 8 chunks +6 lines, -30 lines 0 comments Download
M Source/core/dom/ContainerNode.cpp View 1 2 3 chunks +0 lines, -34 lines 0 comments Download
M Source/core/dom/ContainerNodeAlgorithms.h View 1 1 chunk +2 lines, -3 lines 0 comments Download
M Source/core/dom/ContainerNodeAlgorithms.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Element.h View 1 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 4 chunks +9 lines, -19 lines 0 comments Download
M Source/core/dom/Text.cpp View 1 1 chunk +1 line, -3 lines 0 comments Download
M Source/core/dom/shadow/ShadowRoot.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLInputElement.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/HTMLInputElement.cpp View 1 2 1 chunk +2 lines, -7 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
eseidel
7 years, 6 months ago (2013-06-10 20:21:00 UTC) #1
eseidel
I'm making a new revert, I don't think this one will compile.
7 years, 6 months ago (2013-06-10 20:37:32 UTC) #2
eseidel
The CQ doesn't seem to want to land this... despite the CQ box being checked ...
7 years, 6 months ago (2013-06-11 21:09:57 UTC) #3
Ryan Tseng
CQ isn't picking it up. Is it busted? Logs are saying: 2013-06-11 14:09:43,693 INFO Processing ...
7 years, 6 months ago (2013-06-11 21:12:57 UTC) #4
iannucci
On 2013/06/11 21:12:57, Ryan T. wrote: > CQ isn't picking it up. Is it busted? ...
7 years, 6 months ago (2013-06-11 21:24:21 UTC) #5
eseidel
This revert bug was originally created by drover, then I separately reverted with git and ...
7 years, 6 months ago (2013-06-11 21:26:44 UTC) #6
eseidel
7 years, 6 months ago (2013-06-11 22:27:33 UTC) #7
I've filed https://code.google.com/p/chromium/issues/detail?id=248720 about this
bug, and will close this issue and make a new one for the CQ to munch on.

Powered by Google App Engine
This is Rietveld 408576698