|
|
Descriptioncc: migrate usage of SetValue() to the one that takes TracedValue
According to the TODO in TracedValue::SetValue() the one that takes
TracedValue is cheaper than the one that takes base::Value.
BUG=495628
TEST=cc_unittests --gtest_filter=DisplayItemListTest.*
R=danakj@chromium.org,primiano@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
Review-Url: https://codereview.chromium.org/2708483002
Cr-Commit-Position: refs/heads/master@{#452729}
Committed: https://chromium.googlesource.com/chromium/src/+/07a320f2cd9d3a7967a99d9d71ae70b99ccad6a6
Patch Set 1 #Patch Set 2 : another try #Patch Set 3 : single line change #
Total comments: 4
Messages
Total messages: 24 (14 generated)
Description was changed from ========== cc: migrate usage of SetValue() to the one that takes TracedValue According to the TODO in TracedValue::SetValue() the one that takes TracedValue is cheaper than the one that takes base::Value. BUG=495628 TEST=cc_unittests --gtest_filter=DisplayItemListTest.* R=danakj@chromium.org,primiano@chromium.org ========== to ========== cc: migrate usage of SetValue() to the one that takes TracedValue According to the TODO in TracedValue::SetValue() the one that takes TracedValue is cheaper than the one that takes base::Value. BUG=495628 TEST=cc_unittests --gtest_filter=DisplayItemListTest.* R=danakj@chromium.org,primiano@chromium.org CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel ==========
The CQ bit was checked by tfarina@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Please, take a look when you have a spare time.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by tfarina@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by tfarina@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
On 2017/02/19 at 22:22:59, tfarina wrote: > Please, take a look when you have a spare time. Non-owner LGTM. Thanks, this should indeed be faster as you say, as avoids the value deconstruction and trace-value re-plickling.
https://codereview.chromium.org/2708483002/diff/40001/cc/playback/display_ite... File cc/playback/display_item_list.cc (left): https://codereview.chromium.org/2708483002/diff/40001/cc/playback/display_ite... cc/playback/display_item_list.cc:220: state->SetValue("layer_rect", MathUtil::AsValue(rtree_.GetBounds())); Does a ListValue end up as an array? Or will this require any changes to the tracing code reading it?
https://codereview.chromium.org/2708483002/diff/40001/cc/playback/display_ite... File cc/playback/display_item_list.cc (left): https://codereview.chromium.org/2708483002/diff/40001/cc/playback/display_ite... cc/playback/display_item_list.cc:220: state->SetValue("layer_rect", MathUtil::AsValue(rtree_.GetBounds())); On 2017/02/22 14:48:19, danakj wrote: > Does a ListValue end up as an array? Or will this require any changes to the > tracing code reading it? The code in AddToTracedValue makes an array.
https://codereview.chromium.org/2708483002/diff/40001/cc/playback/display_ite... File cc/playback/display_item_list.cc (left): https://codereview.chromium.org/2708483002/diff/40001/cc/playback/display_ite... cc/playback/display_item_list.cc:220: state->SetValue("layer_rect", MathUtil::AsValue(rtree_.GetBounds())); On 2017/02/22 21:28:56, tfarina wrote: > On 2017/02/22 14:48:19, danakj wrote: > > Does a ListValue end up as an array? Or will this require any changes to the > > tracing code reading it? > > The code in AddToTracedValue makes an array. Yes, I'm wondering what the old code resulted in the tracing code getting. I tried to follow thru and I ended up at some "write bytes" thing.
On 2017/02/22 21:31:10, danakj wrote: > https://codereview.chromium.org/2708483002/diff/40001/cc/playback/display_ite... > File cc/playback/display_item_list.cc (left): > > https://codereview.chromium.org/2708483002/diff/40001/cc/playback/display_ite... > cc/playback/display_item_list.cc:220: state->SetValue("layer_rect", > MathUtil::AsValue(rtree_.GetBounds())); > On 2017/02/22 21:28:56, tfarina wrote: > > On 2017/02/22 14:48:19, danakj wrote: > > > Does a ListValue end up as an array? Or will this require any changes to the > > > tracing code reading it? > > > > The code in AddToTracedValue makes an array. > > Yes, I'm wondering what the old code resulted in the tracing code getting. I > tried to follow thru and I ended up at some "write bytes" thing. Primiano, could you ańswer Dana's questioning?
> Primiano, could you ańswer Dana's questioning? I knew that this codereview looked easy but was a trap :P see reply below, TL;DR I think it's all good https://codereview.chromium.org/2708483002/diff/40001/cc/playback/display_ite... File cc/playback/display_item_list.cc (left): https://codereview.chromium.org/2708483002/diff/40001/cc/playback/display_ite... cc/playback/display_item_list.cc:220: state->SetValue("layer_rect", MathUtil::AsValue(rtree_.GetBounds())); On 2017/02/22 21:31:10, danakj wrote: > On 2017/02/22 21:28:56, tfarina wrote: > > On 2017/02/22 14:48:19, danakj wrote: > > > Does a ListValue end up as an array? Yup correct >Or will this require any changes to the > > > tracing code reading it? Nope this avoid just the base::Value to TracedValue translation in https://cs.chromium.org/chromium/src/base/trace_event/trace_event_argument.cc... > > > > The code in AddToTracedValue makes an array. > > Yes, I'm wondering what the old code resulted in the tracing code getting. I > tried to follow thru and I ended up at some "write bytes" thing. It seems to me that the old code was invoking this: https://cs.chromium.org/chromium/src/cc/base/math_util.cc?rcl=54f7dc97f74fc1b... which takes a rect and construct a base::ListValue The new code will invoke this: https://cs.chromium.org/chromium/src/cc/base/math_util.cc?rcl=54f7dc97f74fc1b... which creates directly a BeginArray in the traced value. When you generically call TracedValue::SetValue(list_value), the ListValue will do a BeginArray/EndArray. So I expect the final JSON to be the same, just this CL will have less rountrips to create the right tracedvalue.
ok thanks! LGTM
The CQ bit was checked by tfarina@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 40001, "attempt_start_ts": 1487900179256940, "parent_rev": "96752f23762f0ad4320bb4aa0737857b5fe582f3", "commit_rev": "07a320f2cd9d3a7967a99d9d71ae70b99ccad6a6"}
Message was sent while issue was closed.
Description was changed from ========== cc: migrate usage of SetValue() to the one that takes TracedValue According to the TODO in TracedValue::SetValue() the one that takes TracedValue is cheaper than the one that takes base::Value. BUG=495628 TEST=cc_unittests --gtest_filter=DisplayItemListTest.* R=danakj@chromium.org,primiano@chromium.org CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel ========== to ========== cc: migrate usage of SetValue() to the one that takes TracedValue According to the TODO in TracedValue::SetValue() the one that takes TracedValue is cheaper than the one that takes base::Value. BUG=495628 TEST=cc_unittests --gtest_filter=DisplayItemListTest.* R=danakj@chromium.org,primiano@chromium.org CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2708483002 Cr-Commit-Position: refs/heads/master@{#452729} Committed: https://chromium.googlesource.com/chromium/src/+/07a320f2cd9d3a7967a99d9d71ae... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/07a320f2cd9d3a7967a99d9d71ae... |