|
|
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
|
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
|
Total messages: 7 (0 generated)
|