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

Issue 2174843003: cc mojo: Use ArrayDataViews in RenderPasses (Closed)

Created:
4 years, 5 months ago by Fady Samuel
Modified:
4 years, 4 months ago
Reviewers:
Tom Sepez, danakj, yzshen1
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, tdresser+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, cc-bugs_chromium.org, ben+mojo_chromium.org, darin (slow to review)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

cc mojo: Use ArrayDataViews in RenderPasses This CL makes use of the newly introduced Array DataViews in cc StructTraits in order to improve serialization (and to a lesser degree deserialization) performance. This CL improves serialization performance by an average of 18% on an HP Z620. Deserialization performance improves between 7 to 10%. Prior to the ability to inspect Array and Struct DataViews in parent StructTraits, we had to do extra work at serialization time in order to capture state that spans individual structs within a larger struct. This CL addresses two of those cases: 1. Previously, QuadList maintained an extra array of materials. This array existed so that we could preallocate the appropriately typed DrawQuads during deserialization. StructTraits assume a preallocated type and populated fields in that type. Alternatively we could have deserialized DrawQuads into unique_ptrs, but cc required that we allocate DrawQuads inline within a buffer in order to minimize the cost of allocations (there can be hundreds of DrawQuads in a CompositorFrame). 2. Previously, SharedQuadStates were serialized independently of DrawQuads. However, in in-memory form, DrawQuads refer to SharedQuadStates via raw pointers. In order to allow DrawQuads and SharedQuadStates to deserialize independently, as was required previously by StructTraits, a third array was serialized "shared_quad_state_references" which was equal in size to the QuadList. Each slot corresponded to an index in the SharedQuadStateList. After the QuadList and SharedQuadStateList were serialized, shared_quad_state_references updated the raw pointers in the DrawQuads in the quad list to refer to the SharedQuadStates. This required revisiting all deserialized DrawQuads again. In both 1. and 2. additional state needed to be allocated on the heap during serialization. In pprof profiling, it became apparent that much of the cost of serialization was in SetupContext. This CL eliminates that cost. Performance measures are available here: https://docs.google.com/a/google.com/spreadsheets/d/13Y0I-BVDrQC4RHIzMSs0vl0QPe8xFAhYMUAXaxoEqgg/pubhtml BUG=624459 TBR=danakj@chromium.org CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel Committed: https://crrev.com/edd40fdc29170e97ab54578fdc5096fc564c0ccb Cr-Commit-Position: refs/heads/master@{#408809}

Patch Set 1 #

Patch Set 2 : A little bit of cleanup #

Total comments: 13

Patch Set 3 : Addressed Yuzhu's comments #

Patch Set 4 : Remove QuadList from mojom #

Patch Set 5 : More code deletion #

Patch Set 6 : Delete quads.typemap #

Total comments: 18

Patch Set 7 : Addressed Yuzhu's comments #

Patch Set 8 : Addresed Tom's concern #

Patch Set 9 : Better solution #

Total comments: 1

Patch Set 10 : Addressed nit #

Patch Set 11 : Fix broken unit test compile #

Total comments: 8

Patch Set 12 : Addressed Dana's comments #

Patch Set 13 : Fix RenderPassId #

Unified diffs Side-by-side diffs Delta from patch set Stats (+321 lines, -394 lines) Patch
M cc/ipc/quads.mojom View 1 2 3 3 chunks +4 lines, -13 lines 0 comments Download
M cc/ipc/quads.typemap View 1 2 3 4 5 1 chunk +0 lines, -20 lines 0 comments Download
M cc/ipc/quads_struct_traits.h View 1 2 3 4 5 6 7 8 9 3 chunks +81 lines, -58 lines 0 comments Download
M cc/ipc/quads_struct_traits.cc View 1 2 3 chunks +46 lines, -84 lines 0 comments Download
M cc/ipc/render_pass.mojom View 1 2 2 chunks +1 line, -4 lines 0 comments Download
M cc/ipc/render_pass.typemap View 1 2 3 4 5 6 1 chunk +10 lines, -3 lines 0 comments Download
M cc/ipc/render_pass_struct_traits.h View 3 4 5 6 2 chunks +0 lines, -15 lines 0 comments Download
M cc/ipc/render_pass_struct_traits.cc View 1 2 3 4 5 6 7 8 2 chunks +25 lines, -49 lines 0 comments Download
M cc/ipc/shared_quad_state.mojom View 1 2 3 4 1 chunk +0 lines, -4 lines 0 comments Download
M cc/ipc/shared_quad_state_struct_traits.h View 1 2 3 4 2 chunks +45 lines, -47 lines 0 comments Download
M cc/ipc/struct_traits_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 12 chunks +44 lines, -41 lines 0 comments Download
M cc/ipc/traits_test_service.mojom View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M cc/ipc/typemaps.gni View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M cc/quads/render_pass.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M cc/quads/render_pass.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +41 lines, -42 lines 0 comments Download
M mojo/public/cpp/bindings/array_traits.h View 1 2 3 4 5 6 1 chunk +3 lines, -1 line 0 comments Download
M mojo/public/cpp/bindings/lib/array_serialization.h View 1 2 3 4 5 6 6 chunks +13 lines, -7 lines 0 comments Download
M mojo/public/cpp/bindings/lib/map_serialization.h View 1 2 1 chunk +5 lines, -2 lines 0 comments Download

Messages

Total messages: 92 (52 generated)
Fady Samuel
Hi Yuzhu, This CL is not yet ready for formal review but I thought I'd ...
4 years, 5 months ago (2016-07-22 20:45:27 UTC) #3
Fady Samuel
PTAL Yuzhu!
4 years, 5 months ago (2016-07-25 21:23:32 UTC) #16
yzshen1
https://codereview.chromium.org/2174843003/diff/20001/cc/ipc/quads.mojom File cc/ipc/quads.mojom (right): https://codereview.chromium.org/2174843003/diff/20001/cc/ipc/quads.mojom#newcode131 cc/ipc/quads.mojom:131: // Index into the containing pass' shared quad state ...
4 years, 4 months ago (2016-07-26 17:56:03 UTC) #17
yzshen1
Btw, please consider adding perf tests with quad/render pass numbers that are more typical in ...
4 years, 4 months ago (2016-07-26 18:00:44 UTC) #18
Fady Samuel
PTAL Yuzhu! Net negative LOC! w00t! https://codereview.chromium.org/2174843003/diff/20001/cc/ipc/quads.mojom File cc/ipc/quads.mojom (right): https://codereview.chromium.org/2174843003/diff/20001/cc/ipc/quads.mojom#newcode131 cc/ipc/quads.mojom:131: // Index into ...
4 years, 4 months ago (2016-07-27 23:52:23 UTC) #19
Fady Samuel
PTAL Yuzhu! It turned out I could delete even more code!
4 years, 4 months ago (2016-07-28 12:17:00 UTC) #24
Fady Samuel
I've added a couple more serialization/deserialization that are perhaps more representation of real CompositorFrame sizes: ...
4 years, 4 months ago (2016-07-28 13:17:14 UTC) #25
Fady Samuel
On 2016/07/28 13:17:14, Fady Samuel wrote: > I've added a couple more serialization/deserialization that are ...
4 years, 4 months ago (2016-07-28 13:17:34 UTC) #26
yzshen1
https://codereview.chromium.org/2174843003/diff/20001/cc/ipc/shared_quad_state_struct_traits.h File cc/ipc/shared_quad_state_struct_traits.h (right): https://codereview.chromium.org/2174843003/diff/20001/cc/ipc/shared_quad_state_struct_traits.h#newcode13 cc/ipc/shared_quad_state_struct_traits.h:13: struct OptSharedQuadState { On 2016/07/27 23:52:23, Fady Samuel wrote: ...
4 years, 4 months ago (2016-07-28 18:25:19 UTC) #27
Fady Samuel
PTAL Yuzhu! https://codereview.chromium.org/2174843003/diff/100001/cc/ipc/quads_struct_traits.h File cc/ipc/quads_struct_traits.h (right): https://codereview.chromium.org/2174843003/diff/100001/cc/ipc/quads_struct_traits.h#newcode479 cc/ipc/quads_struct_traits.h:479: struct QuadListArray { On 2016/07/28 18:25:19, yzshen1 ...
4 years, 4 months ago (2016-07-28 19:53:32 UTC) #28
yzshen1
LGTM!
4 years, 4 months ago (2016-07-28 21:14:29 UTC) #29
Fady Samuel
+tsepez@ for security
4 years, 4 months ago (2016-07-28 22:25:13 UTC) #31
Tom Sepez
Per conversation with fsamuel, we should check that the first drawquad should have a non-null ...
4 years, 4 months ago (2016-07-28 22:47:19 UTC) #32
Tom Sepez
++lgtm
4 years, 4 months ago (2016-07-28 22:56:04 UTC) #33
Fady Samuel
TBR'ing danakj@ for: cc/ipc/quads.typemap cc/ipc/render_pass.typemap cc/ipc/struct_traits_unittest.cc cc/ipc/typemaps.gni These are mojo specific files which Yuzhu has ...
4 years, 4 months ago (2016-07-28 22:56: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/2174843003/160001
4 years, 4 months ago (2016-07-28 22:57:26 UTC) #39
commit-bot: I haz the power
Your CL was about to rely on recently removed CQ feature(s): * master.tryserver.blink builder linux_blink_rel ...
4 years, 4 months ago (2016-07-28 22:57:29 UTC) #41
danakj
On Thu, Jul 28, 2016 at 3:56 PM, <fsamuel@chromium.org> wrote: > TBR'ing danakj@ for: > ...
4 years, 4 months ago (2016-07-28 23:37:12 UTC) #42
danakj
LGTM https://codereview.chromium.org/2174843003/diff/160001/cc/ipc/struct_traits_unittest.cc File cc/ipc/struct_traits_unittest.cc (right): https://codereview.chromium.org/2174843003/diff/160001/cc/ipc/struct_traits_unittest.cc#newcode415 cc/ipc/struct_traits_unittest.cc:415: QuadList input; unused?
4 years, 4 months ago (2016-07-28 23:37:51 UTC) #43
yzshen1
Maybe it is okay to let mojo OWNERs be also owners for all *.typemap files? ...
4 years, 4 months ago (2016-07-28 23:42:07 UTC) #44
yzshen1
On Thu, Jul 28, 2016 at 4:41 PM, Yuzhu Shen <yzshen@chromium.org> wrote: > Maybe it ...
4 years, 4 months ago (2016-07-28 23:43:17 UTC) #45
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/2174843003/180001
4 years, 4 months ago (2016-07-29 10:55:22 UTC) #52
commit-bot: I haz the power
Your CL was about to rely on recently removed CQ feature(s): * master.tryserver.blink builder linux_blink_rel ...
4 years, 4 months ago (2016-07-29 10:55:25 UTC) #54
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/2174843003/180001
4 years, 4 months ago (2016-07-29 10:57:29 UTC) #56
commit-bot: I haz the power
Your CL was about to rely on recently removed CQ feature(s): * master.tryserver.blink builder linux_blink_rel ...
4 years, 4 months ago (2016-07-29 10:57:32 UTC) #58
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/2174843003/180001
4 years, 4 months ago (2016-07-29 11:03:08 UTC) #60
commit-bot: I haz the power
Your CL was about to rely on recently removed CQ feature(s): * master.tryserver.blink builder linux_blink_rel ...
4 years, 4 months ago (2016-07-29 11:03:11 UTC) #62
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/2174843003/180001
4 years, 4 months ago (2016-07-29 15:39:09 UTC) #64
commit-bot: I haz the power
Your CL was about to rely on recently removed CQ feature(s): * master.tryserver.blink builder linux_blink_rel ...
4 years, 4 months ago (2016-07-29 15:39:12 UTC) #66
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/2174843003/180001
4 years, 4 months ago (2016-07-29 15:55:29 UTC) #69
commit-bot: I haz the power
Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_compile_dbg/builds/104275) linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, ...
4 years, 4 months ago (2016-07-29 16:08:57 UTC) #71
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/2174843003/180001
4 years, 4 months ago (2016-07-29 16:57:41 UTC) #73
commit-bot: I haz the power
Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_compile_dbg/builds/104313) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 4 months ago (2016-07-29 17:13:00 UTC) #75
Fady Samuel
Heh, I guess move_only as a keyword in the typemap did nothing on my local ...
4 years, 4 months ago (2016-07-29 20:11:00 UTC) #77
danakj
https://codereview.chromium.org/2174843003/diff/200001/cc/ipc/struct_traits_unittest.cc File cc/ipc/struct_traits_unittest.cc (right): https://codereview.chromium.org/2174843003/diff/200001/cc/ipc/struct_traits_unittest.cc#newcode488 cc/ipc/struct_traits_unittest.cc:488: ASSERT_EQ(6u, output->quad_list.size()); store this before moving it rather than ...
4 years, 4 months ago (2016-07-29 20:35:57 UTC) #80
Fady Samuel
PTAL Dana! Thanks! https://codereview.chromium.org/2174843003/diff/200001/cc/ipc/struct_traits_unittest.cc File cc/ipc/struct_traits_unittest.cc (right): https://codereview.chromium.org/2174843003/diff/200001/cc/ipc/struct_traits_unittest.cc#newcode488 cc/ipc/struct_traits_unittest.cc:488: ASSERT_EQ(6u, output->quad_list.size()); On 2016/07/29 20:35:57, danakj ...
4 years, 4 months ago (2016-07-29 21:06:32 UTC) #81
danakj
LGTM
4 years, 4 months ago (2016-07-29 21:15:06 UTC) #84
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/2174843003/240001
4 years, 4 months ago (2016-07-29 22:19:10 UTC) #89
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 4 months ago (2016-07-29 23:58:37 UTC) #90
commit-bot: I haz the power
4 years, 4 months ago (2016-07-30 00:00:28 UTC) #92
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/edd40fdc29170e97ab54578fdc5096fc564c0ccb
Cr-Commit-Position: refs/heads/master@{#408809}

Powered by Google App Engine
This is Rietveld 408576698