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

Issue 2821193003: Store nonAttachedStyle on NodeLayoutData instead of on HashMap in Document. (Closed)

Created:
3 years, 8 months ago by nainar
Modified:
3 years, 8 months ago
Reviewers:
meade_UTC10, esprehn, rune
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-dom_chromium.org, blink-reviews-style_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Store nonAttachedStyle on NodeLayoutData instead of on HashMap in Document. This patch stores the ComputedStyle to be passed between recalcStyle and rebuildLayoutTree on NodeLayoutData instead of storing it on the HashMap on Document. This potentially fixes the perf regression in crbug.com/700093 as it removes the HashMap lookup in SharedStyleFinder and making it a free operation again. BUG=595137, 700093 Review-Url: https://codereview.chromium.org/2821193003 Cr-Commit-Position: refs/heads/master@{#467542} Committed: https://chromium.googlesource.com/chromium/src/+/95862a52c7bc1a5846259619243289805d095b70

Patch Set 1 #

Total comments: 5

Patch Set 2 : Add DCHECK and assign nullptr in constructor #

Total comments: 11

Patch Set 3 : rune@'s comments #

Patch Set 4 : Clear nonAttachedStyle post reattachLayoutTree #

Patch Set 5 : Clear NonAttachedStyle in (Attach/Detach)LayoutTree #

Total comments: 2

Patch Set 6 : Revert back to rune@'s lgtmed patch #

Unified diffs Side-by-side diffs Delta from patch set Stats (+57 lines, -33 lines) Patch
M third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.h View 1 2 3 4 2 chunks +0 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 4 chunks +0 lines, -18 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.cpp View 1 2 3 4 5 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Node.h View 1 2 3 4 4 chunks +26 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Node.cpp View 1 2 3 4 5 1 chunk +27 lines, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 46 (30 generated)
nainar
Elliott, PTAL? Thanks! https://codereview.chromium.org/2821193003/diff/1/third_party/WebKit/Source/core/dom/Node.cpp File third_party/WebKit/Source/core/dom/Node.cpp (right): https://codereview.chromium.org/2821193003/diff/1/third_party/WebKit/Source/core/dom/Node.cpp#newcode609 third_party/WebKit/Source/core/dom/Node.cpp:609: layout_object, node_layout_data->GetNonAttachedStyle()); at this stage the ...
3 years, 8 months ago (2017-04-18 03:48:12 UTC) #4
esprehn
This looks legit to me, we might want to think about a way to refactor ...
3 years, 8 months ago (2017-04-18 21:31:10 UTC) #8
nainar
https://codereview.chromium.org/2821193003/diff/1/third_party/WebKit/Source/core/dom/Node.cpp File third_party/WebKit/Source/core/dom/Node.cpp (right): https://codereview.chromium.org/2821193003/diff/1/third_party/WebKit/Source/core/dom/Node.cpp#newcode609 third_party/WebKit/Source/core/dom/Node.cpp:609: layout_object, node_layout_data->GetNonAttachedStyle()); Done. https://codereview.chromium.org/2821193003/diff/1/third_party/WebKit/Source/core/dom/Node.cpp#newcode633 third_party/WebKit/Source/core/dom/Node.cpp:633: node_layout_data = new NodeLayoutData(node_layout_data->GetLayoutObject(), ...
3 years, 8 months ago (2017-04-19 01:38:34 UTC) #11
esprehn
FYI: meade@ should do a review of this too. Perhaps the two of you could ...
3 years, 8 months ago (2017-04-19 17:57:45 UTC) #14
rune
https://codereview.chromium.org/2821193003/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (left): https://codereview.chromium.org/2821193003/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp#oldcode2132 third_party/WebKit/Source/core/dom/Document.cpp:2132: non_attached_style_.Clear(); Do we retain the ComputedStyle on each node ...
3 years, 8 months ago (2017-04-19 20:34:53 UTC) #15
nainar
New patch in response to rune@'s comments.esprehn@ will run meade@ through the code and look ...
3 years, 8 months ago (2017-04-19 23:43:41 UTC) #18
meade_UTC10
lgtm
3 years, 8 months ago (2017-04-20 03:12:11 UTC) #21
nainar
Thanks for the review meade@, will wait on rune@ to voice off on the concern ...
3 years, 8 months ago (2017-04-20 06:48:16 UTC) #22
rune
https://codereview.chromium.org/2821193003/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (left): https://codereview.chromium.org/2821193003/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp#oldcode2132 third_party/WebKit/Source/core/dom/Document.cpp:2132: non_attached_style_.Clear(); On 2017/04/19 23:43:41, nainar wrote: > On 2017/04/19 ...
3 years, 8 months ago (2017-04-20 08:56:39 UTC) #23
nainar
rune@, responded to your comments inline. PTAL? Thanks! https://codereview.chromium.org/2821193003/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (left): https://codereview.chromium.org/2821193003/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp#oldcode2132 third_party/WebKit/Source/core/dom/Document.cpp:2132: non_attached_style_.Clear(); ...
3 years, 8 months ago (2017-04-21 00:51:30 UTC) #28
rune
lgtm https://codereview.chromium.org/2821193003/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (left): https://codereview.chromium.org/2821193003/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp#oldcode2132 third_party/WebKit/Source/core/dom/Document.cpp:2132: non_attached_style_.Clear(); On 2017/04/21 00:51:30, nainar wrote: > On ...
3 years, 8 months ago (2017-04-21 07:41:46 UTC) #29
nainar
rune@, Made the changes you suggested. PTAL? Thanks! https://codereview.chromium.org/2821193003/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (left): https://codereview.chromium.org/2821193003/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp#oldcode2132 third_party/WebKit/Source/core/dom/Document.cpp:2132: non_attached_style_.Clear(); ...
3 years, 8 months ago (2017-04-26 02:55:16 UTC) #32
rune
https://codereview.chromium.org/2821193003/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp File third_party/WebKit/Source/core/dom/Document.cpp (left): https://codereview.chromium.org/2821193003/diff/20001/third_party/WebKit/Source/core/dom/Document.cpp#oldcode2132 third_party/WebKit/Source/core/dom/Document.cpp:2132: non_attached_style_.Clear(); On 2017/04/26 02:55:16, nainar wrote: > On 2017/04/21 ...
3 years, 8 months ago (2017-04-26 08:47:28 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2821193003/100001
3 years, 8 months ago (2017-04-27 01:39:13 UTC) #42
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/chromium/src/+/95862a52c7bc1a5846259619243289805d095b70
3 years, 8 months ago (2017-04-27 01:45:23 UTC) #45
nainar
3 years, 8 months ago (2017-04-27 01:50:06 UTC) #46
Message was sent while issue was closed.
Should have sent this before landing.

https://codereview.chromium.org/2821193003/diff/80001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/dom/Node.cpp (right):

https://codereview.chromium.org/2821193003/diff/80001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/dom/Node.cpp:633: data_.node_layout_data_ =
&NodeLayoutData::SharedEmptyData();
On 2017/04/26 at 08:47:28, rune wrote:
> Won't this leak the previously set node_layout_data_?
> 
> Could we just keep the node_layout_data_ like we do for rare data?

Yup, I see what you mean. I have reverted the CL back to the patch where I had
your LGTM last. Sorry about that I thought it was an lgtm with the suggested
change. 

I will take another stab at this when I try to unify the two ComputedStyles.

Powered by Google App Engine
This is Rietveld 408576698