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

Issue 669803002: Optimize for horizontal writing mode (Closed)

Created:
6 years, 2 months ago by eae
Modified:
6 years, 1 month ago
CC:
darktears, apavlov+blink_chromium.org, blink-layers+watch_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-dom_chromium.org, blink-reviews-rendering, dglazkov+blink, eae+blinkwatch, ed+blinkwatch_opera.com, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, rwlbuis, rune+blink, sof, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Optimize for horizontal writing mode Optimize layout and painting by avoiding or short-circuiting vertical writing mode logic unless it is used at least once in a document. A per-document containsAnyVerticalWritingModes flag is introduced that is set the first time a vertical writing mode is encountered. Unless this flag has been set all flipForWritingMode functions short-circuit. Some of the RenderBox flip methods is moved to the header file to allow for better inlining. Early testing indicates a ~10% performance improvement across the board with 35 of our 42 layout performance tests showing a 6% to 19% performance improvement. The remaining 7 tests show no significant improvement and none of them show any regression. R=dglazkov@chromium.org, pdr@chromium.org BUG=425364 TEST=PerformanceTests/Layout Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=184217

Patch Set 1 #

Patch Set 2 : #

Total comments: 10

Patch Set 3 : Renamed flag to containsAnyVerticalWritingModes as suggested by pdr #

Patch Set 4 : Moved logic to RenderBlock as suggested by pdr #

Total comments: 5

Patch Set 5 : Changed RenderView to use hasFlippedBlocksWritingMode #

Total comments: 2

Patch Set 6 : Fixed for horizontal-bt #

Total comments: 1

Patch Set 7 : w compile fix #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+149 lines, -136 lines) Patch
M Source/core/css/resolver/StyleBuilderCustom.cpp View 1 2 3 4 5 6 1 chunk +6 lines, -2 lines 0 comments Download
M Source/core/dom/Document.h View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/frame/FrameView.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/page/EventHandler.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/page/PrintContext.cpp View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/paint/BlockPainter.cpp View 1 2 3 4 5 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/paint/LayerPainter.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/InlineBox.cpp View 1 2 3 4 3 chunks +7 lines, -6 lines 0 comments Download
M Source/core/rendering/LayoutState.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderBlock.cpp View 1 2 3 8 chunks +10 lines, -10 lines 0 comments Download
M Source/core/rendering/RenderBlockFlow.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderBox.h View 1 2 3 1 chunk +43 lines, -6 lines 0 comments Download
M Source/core/rendering/RenderBox.cpp View 1 2 3 4 5 5 chunks +11 lines, -57 lines 1 comment Download
M Source/core/rendering/RenderFlexibleBox.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderFlowThread.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderGeometryMap.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderInline.cpp View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderLayer.h View 2 chunks +1 line, -2 lines 0 comments Download
M Source/core/rendering/RenderLayer.cpp View 1 2 3 4 5 4 chunks +17 lines, -9 lines 0 comments Download
M Source/core/rendering/RenderListMarker.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderObject.h View 1 2 3 4 5 2 chunks +6 lines, -1 line 0 comments Download
M Source/core/rendering/RenderObject.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderReplaced.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderTable.h View 1 2 3 2 chunks +8 lines, -8 lines 0 comments Download
M Source/core/rendering/RenderTable.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderTableCell.cpp View 1 2 3 6 chunks +10 lines, -10 lines 0 comments Download
M Source/core/rendering/RenderText.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderView.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RootInlineBox.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/shapes/ShapeOutsideInfo.cpp View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/rendering/style/RenderStyle.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 29 (8 generated)
eae
Ready for review. Not quite sure that the Document itself is the right place for ...
6 years, 2 months ago (2014-10-21 21:19:52 UTC) #4
pdr.
This is incredible! https://codereview.chromium.org/669803002/diff/20001/Source/core/dom/Document.h File Source/core/dom/Document.h (right): https://codereview.chromium.org/669803002/diff/20001/Source/core/dom/Document.h#newcode785 Source/core/dom/Document.h:785: bool hasVerticalWritingMode() const { return m_hasVerticalWritingMode; ...
6 years, 2 months ago (2014-10-21 22:11:26 UTC) #5
eae
https://codereview.chromium.org/669803002/diff/20001/Source/core/dom/Document.h File Source/core/dom/Document.h (right): https://codereview.chromium.org/669803002/diff/20001/Source/core/dom/Document.h#newcode785 Source/core/dom/Document.h:785: bool hasVerticalWritingMode() const { return m_hasVerticalWritingMode; } On 2014/10/21 ...
6 years, 2 months ago (2014-10-21 22:21:46 UTC) #6
pdr.
https://codereview.chromium.org/669803002/diff/20001/Source/core/rendering/InlineBox.cpp File Source/core/rendering/InlineBox.cpp (right): https://codereview.chromium.org/669803002/diff/20001/Source/core/rendering/InlineBox.cpp#newcode324 Source/core/rendering/InlineBox.cpp:324: if (!UNLIKELY(renderer().document().hasVerticalWritingMode()) On 2014/10/21 at 22:21:46, eae wrote: > ...
6 years, 2 months ago (2014-10-21 22:38:15 UTC) #7
eae
On 2014/10/21 22:38:15, pdr wrote: > https://codereview.chromium.org/669803002/diff/20001/Source/core/rendering/InlineBox.cpp > File Source/core/rendering/InlineBox.cpp (right): > > https://codereview.chromium.org/669803002/diff/20001/Source/core/rendering/InlineBox.cpp#newcode324 > ...
6 years, 2 months ago (2014-10-21 22:41:21 UTC) #8
eae
Moving the logic into RenderBlock as suggested, had no negative performance impact and cleaned up ...
6 years, 2 months ago (2014-10-21 23:16:37 UTC) #9
leviw_travelin_and_unemployed
https://codereview.chromium.org/669803002/diff/60001/Source/core/rendering/InlineBox.cpp File Source/core/rendering/InlineBox.cpp (right): https://codereview.chromium.org/669803002/diff/60001/Source/core/rendering/InlineBox.cpp#newcode321 Source/core/rendering/InlineBox.cpp:321: void InlineBox::flipForWritingMode(FloatRect& rect) I wonder how much of a ...
6 years, 2 months ago (2014-10-21 23:30:00 UTC) #11
eae
On 2014/10/21 23:30:00, leviw wrote: > https://codereview.chromium.org/669803002/diff/60001/Source/core/rendering/InlineBox.cpp > File Source/core/rendering/InlineBox.cpp (right): > > https://codereview.chromium.org/669803002/diff/60001/Source/core/rendering/InlineBox.cpp#newcode321 > ...
6 years, 2 months ago (2014-10-21 23:32:22 UTC) #12
leviw_travelin_and_unemployed
On 2014/10/21 at 23:32:22, eae wrote: > On 2014/10/21 23:30:00, leviw wrote: > > https://codereview.chromium.org/669803002/diff/60001/Source/core/rendering/InlineBox.cpp ...
6 years, 2 months ago (2014-10-21 23:35:16 UTC) #13
pdr.
A few more minor comments. https://codereview.chromium.org/669803002/diff/60001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (left): https://codereview.chromium.org/669803002/diff/60001/Source/core/frame/FrameView.cpp#oldcode2880 Source/core/frame/FrameView.cpp:2880: return renderView->style()->isFlippedBlocksWritingMode(); Why not ...
6 years, 2 months ago (2014-10-21 23:35:34 UTC) #15
eae
On 2014/10/21 23:35:34, pdr wrote: > A few more minor comments. > > https://codereview.chromium.org/669803002/diff/60001/Source/core/frame/FrameView.cpp > ...
6 years, 2 months ago (2014-10-21 23:39:42 UTC) #16
eae
Changed it to use RenderView to use hasFlippedBlocksWritingMode and moved comment as suggested. Did not ...
6 years, 2 months ago (2014-10-21 23:44:35 UTC) #17
eae
Hmm, one of the changes between patchset 2 and 5 introduced a bug breaking some ...
6 years, 2 months ago (2014-10-22 00:40:58 UTC) #18
eae
Hmm, one of the changes between patchset 2 and 5 introduced a bug breaking some ...
6 years, 2 months ago (2014-10-22 00:41:19 UTC) #19
pdr.
LGTM % compile issue. @leviw, could you please add your blessing as well? https://codereview.chromium.org/669803002/diff/80001/Source/core/page/EventHandler.cpp File ...
6 years, 2 months ago (2014-10-22 18:41:58 UTC) #20
pdr.
https://codereview.chromium.org/669803002/diff/100001/Source/core/page/PrintContext.cpp File Source/core/page/PrintContext.cpp (right): https://codereview.chromium.org/669803002/diff/100001/Source/core/page/PrintContext.cpp#newcode126 Source/core/page/PrintContext.cpp:126: if (view->style()->slowIsFlippedBlocksWritingMode()) { (We'll be doing these in a ...
6 years, 2 months ago (2014-10-22 18:42:54 UTC) #21
leviw_travelin_and_unemployed
lgtm https://codereview.chromium.org/669803002/diff/80001/Source/core/page/EventHandler.cpp File Source/core/page/EventHandler.cpp (right): https://codereview.chromium.org/669803002/diff/80001/Source/core/page/EventHandler.cpp#newcode906 Source/core/page/EventHandler.cpp:906: direction, curBox->isHorizontalWritingMode(), curBox->style()->slowIsFlippedBlocksWritingMode()); On 2014/10/22 18:41:58, pdr wrote: ...
6 years, 2 months ago (2014-10-22 18:50:27 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/669803002/120001
6 years, 2 months ago (2014-10-22 19:40:04 UTC) #25
commit-bot: I haz the power
Committed patchset #7 (id:120001) as 184217
6 years, 2 months ago (2014-10-22 20:17:59 UTC) #26
chrishtr
Cool. https://codereview.chromium.org/669803002/diff/120001/Source/core/rendering/RenderBox.cpp File Source/core/rendering/RenderBox.cpp (right): https://codereview.chromium.org/669803002/diff/120001/Source/core/rendering/RenderBox.cpp#newcode3237 Source/core/rendering/RenderBox.cpp:3237: if (containerBlock->style()->slowIsFlippedBlocksWritingMode() && child->isHorizontalWritingMode() == containerBlock->isHorizontalWritingMode()) { Are ...
6 years, 1 month ago (2014-10-28 18:18:21 UTC) #28
pdr.
6 years, 1 month ago (2014-10-28 18:32:28 UTC) #29
Message was sent while issue was closed.
On 2014/10/28 at 18:18:21, chrishtr wrote:
> Cool.
> 
>
https://codereview.chromium.org/669803002/diff/120001/Source/core/rendering/R...
> File Source/core/rendering/RenderBox.cpp (right):
> 
>
https://codereview.chromium.org/669803002/diff/120001/Source/core/rendering/R...
> Source/core/rendering/RenderBox.cpp:3237: if
(containerBlock->style()->slowIsFlippedBlocksWritingMode() &&
child->isHorizontalWritingMode() == containerBlock->isHorizontalWritingMode()) {
> Are cases like this ones that didn't make the metric faster?

Unfortunately this patch didn't show the perf wins we had hoped for :( Emil's
numbers were correct on his machine but for some reason they didn't translate to
perf wins on the bots.

Emil's out this week but I think the plan is to roll this out and dig back into
it next week.

Powered by Google App Engine
This is Rietveld 408576698