Reduce copying of local data structures in GeometryMapper and PaintLayerClipper.
In particular, changes return values from FloatClipRect to const FloatClipRect&,
to avoid extra data structure copies.
In local testing, this CL produces up to a 10% improvement on the
rasterize_and_record_micro.partial_invalidation benchmark.
BUG=692614
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Review-Url: https://codereview.chromium.org/2745563004
Cr-Commit-Position: refs/heads/master@{#456011}
Committed: https://chromium.googlesource.com/chromium/src/+/05c00d2035047fa9d210d95afedf8bd063bccc33
Description was changed from ========== none none BUG= ========== to ========== none none BUG= CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 ...
3 years, 9 months ago
(2017-03-09 19:59:27 UTC)
#1
Description was changed from
==========
none
none
BUG=
==========
to
==========
none
none
BUG=
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
==========
chrishtr
Description was changed from ========== none none BUG= CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 ========== to ========== Reduce copying of ...
3 years, 9 months ago
(2017-03-09 20:21:40 UTC)
#2
Description was changed from
==========
none
none
BUG=
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
==========
to
==========
Reduce copying of local data structures in GeometryMapper and PaintLayerClipper.
BUG=692614
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
==========
chrishtr
The CQ bit was checked by chrishtr@chromium.org to run a CQ dry run
3 years, 9 months ago
(2017-03-09 22:33:31 UTC)
#3
Description was changed from ========== Reduce copying of local data structures in GeometryMapper and PaintLayerClipper. ...
3 years, 9 months ago
(2017-03-09 22:39:06 UTC)
#7
Description was changed from
==========
Reduce copying of local data structures in GeometryMapper and PaintLayerClipper.
BUG=692614
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
==========
to
==========
Reduce copying of local data structures in GeometryMapper and PaintLayerClipper.
In local testing, this CL produces up to a 10% improvement on the
rasterize_and_record_micro.partial_invalidation benchmark.
BUG=692614
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
==========
3 years, 9 months ago
(2017-03-09 23:25:37 UTC)
#9
chrishtr
Description was changed from ========== Reduce copying of local data structures in GeometryMapper and PaintLayerClipper. ...
3 years, 9 months ago
(2017-03-09 23:37:26 UTC)
#10
Description was changed from
==========
Reduce copying of local data structures in GeometryMapper and PaintLayerClipper.
In local testing, this CL produces up to a 10% improvement on the
rasterize_and_record_micro.partial_invalidation benchmark.
BUG=692614
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
==========
to
==========
Reduce copying of local data structures in GeometryMapper and PaintLayerClipper.
In particular, changes return values from FloatClipRect to const FloatClipRect&,
to avoid extra data structure copies.
In local testing, this CL produces up to a 10% improvement on the
rasterize_and_record_micro.partial_invalidation benchmark.
BUG=692614
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
==========
Xianzhu
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp File third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp (right): https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp#newcode141 third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp:141: if (!object.hasLayer()) (Can be follow-up) We can tighten this ...
3 years, 9 months ago
(2017-03-10 00:06:49 UTC)
#11
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp (right):
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp:141: if
(!object.hasLayer())
(Can be follow-up) We can tighten this condition by checking some fast subset of
conditions in shouldCreateSubsequence() in PaintLayerPainter.cpp, to increase
chance of early returns.
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp:149:
(Can be follow-up) We can also check for some fast subset of conditions in
shouldCreateSubsequence() in PaintLayerPainter.cpp to early return if we won't
create subsequnece for the layer.
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp:154:
*ancestorPaintProperties.localBorderBoxProperties();
(Can be follow-up) If using the condition I proposed below line 178, the above
statement can be moved into the condition block. We can use
const auto* ancestorClip =
ancestorPaintProperties.localBorderBoxProperties()->clip()
instead of ancestorState before the condition.
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp:178: RefPtr<ClipRects>
clipRects = ClipRects::create();
(Can be follow-up) We can also skip line 178-210 if there won't be any clip,
like:
RefPtr<ClipRects> clipRects;
if (ancestorClip != context.treeBuilderContext.current.clip &&
ancestorClip != context.treeBuilderContext.fixedPosition.clip &&
ancestorClip != context.treeBuilderContext.absolutePositon.clip) {
...
}
ClipRects* previousClipRects = ...
if ((!clipRects && !previousClipRects) ||
(clipRects && previousClipRects && *clipRects == *previousClipRects))
return;
clear flags;
...
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
File third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp
(left):
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp:33:
Nit: Keep the blank line.
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
File third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp
(right):
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp:90: const
FloatClipRect& GeometryMapper::localToAncestorVisualRectInternal(
It seems that we always return a temporary rect from this function, so returning
a reference seems not to worth the complexity.
Can we just use an output parameter?
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
3 years, 9 months ago
(2017-03-10 00:15:43 UTC)
#12
3 years, 9 months ago
(2017-03-10 00:15:44 UTC)
#13
Dry run: This issue passed the CQ dry run.
chrishtr
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp File third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp (right): https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp#newcode178 third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp:178: RefPtr<ClipRects> clipRects = ClipRects::create(); On 2017/03/10 at 00:06:49, Xianzhu ...
3 years, 9 months ago
(2017-03-10 01:45:30 UTC)
#14
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp (right):
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp:178: RefPtr<ClipRects>
clipRects = ClipRects::create();
On 2017/03/10 at 00:06:49, Xianzhu wrote:
> (Can be follow-up) We can also skip line 178-210 if there won't be any clip,
like:
> RefPtr<ClipRects> clipRects;
> if (ancestorClip != context.treeBuilderContext.current.clip &&
> ancestorClip != context.treeBuilderContext.fixedPosition.clip &&
> ancestorClip != context.treeBuilderContext.absolutePositon.clip) {
> ...
> }
> ClipRects* previousClipRects = ...
> if ((!clipRects && !previousClipRects) ||
> (clipRects && previousClipRects && *clipRects == *previousClipRects))
> return;
>
> clear flags;
> ...
Do you mean if ancestorState.clip() is above all of those? Yes. I wonder if this
would
improve things though. It would avoid some allocations though. Will try in a
followup.
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
File third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp
(left):
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp:33:
On 2017/03/10 at 00:06:49, Xianzhu wrote:
> Nit: Keep the blank line.
Done.
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
File third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp
(right):
https://codereview.chromium.org/2745563004/diff/150001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp:90: const
FloatClipRect& GeometryMapper::localToAncestorVisualRectInternal(
On 2017/03/10 at 00:06:49, Xianzhu wrote:
> It seems that we always return a temporary rect from this function, so
returning a reference seems not to worth the complexity.
>
> Can we just use an output parameter?
Done. Good idea, it made the code a lot simpler, letting me remove a bunch of
hasRadius stuff since
visual rect use cases don't care about rounded corners.
chrishtr
https://codereview.chromium.org/2745563004/diff/170001/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp File third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp (right): https://codereview.chromium.org/2745563004/diff/170001/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp#newcode425 third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp:425: clipRect2.setRect(clip2->clipRect().rect()); Somehow I fixed a bug in this CL ...
3 years, 9 months ago
(2017-03-10 01:46:23 UTC)
#15
CQ is committing da patch. Bot data: {"patchset_id": 170001, "attempt_start_ts": 1489122336732400, "parent_rev": "04b3fc7475401166b44c14b201fb957a66436f1d", "commit_rev": "05c00d2035047fa9d210d95afedf8bd063bccc33"}
3 years, 9 months ago
(2017-03-10 06:50:36 UTC)
#19
CQ is committing da patch.
Bot data: {"patchset_id": 170001, "attempt_start_ts": 1489122336732400,
"parent_rev": "04b3fc7475401166b44c14b201fb957a66436f1d", "commit_rev":
"05c00d2035047fa9d210d95afedf8bd063bccc33"}
commit-bot: I haz the power
Description was changed from ========== Reduce copying of local data structures in GeometryMapper and PaintLayerClipper. ...
3 years, 9 months ago
(2017-03-10 06:51:30 UTC)
#20
Message was sent while issue was closed.
Description was changed from
==========
Reduce copying of local data structures in GeometryMapper and PaintLayerClipper.
In particular, changes return values from FloatClipRect to const FloatClipRect&,
to avoid extra data structure copies.
In local testing, this CL produces up to a 10% improvement on the
rasterize_and_record_micro.partial_invalidation benchmark.
BUG=692614
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
==========
to
==========
Reduce copying of local data structures in GeometryMapper and PaintLayerClipper.
In particular, changes return values from FloatClipRect to const FloatClipRect&,
to avoid extra data structure copies.
In local testing, this CL produces up to a 10% improvement on the
rasterize_and_record_micro.partial_invalidation benchmark.
BUG=692614
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Review-Url: https://codereview.chromium.org/2745563004
Cr-Commit-Position: refs/heads/master@{#456011}
Committed:
https://chromium.googlesource.com/chromium/src/+/05c00d2035047fa9d210d95afedf...
==========
commit-bot: I haz the power
Committed patchset #10 (id:170001) as https://chromium.googlesource.com/chromium/src/+/05c00d2035047fa9d210d95afedf8bd063bccc33
3 years, 9 months ago
(2017-03-10 06:51:32 UTC)
#21
Issue 2745563004: Reduce copying of local data structures in GeometryMapper and PaintLayerClipper.
(Closed)
Created 3 years, 9 months ago by chrishtr
Modified 3 years, 9 months ago
Reviewers: pdr., Xianzhu
Base URL:
Comments: 10