Chromium Code Reviews| Index: cc/ipc/cc_serialization_perftest.cc |
| diff --git a/cc/ipc/cc_serialization_perftest.cc b/cc/ipc/cc_serialization_perftest.cc |
| index 30d7835a1cc4198be9a3c84717abdece2f27a150..b91cd853a3e431db89b6991d2d0e931642a07d4a 100644 |
| --- a/cc/ipc/cc_serialization_perftest.cc |
| +++ b/cc/ipc/cc_serialization_perftest.cc |
| @@ -60,7 +60,9 @@ class CCSerializationPerfTest : public testing::Test { |
| size_t count = 0; |
| while (start < end) { |
| for (int i = 0; i < kTimeCheckInterval; ++i) { |
| - ++count; |
| + base::TimeTicks now = base::TimeTicks::Now(); |
| + if (now < end) |
| + ++count; |
| CompositorFrame compositor_frame; |
| ReadMessage(&msg, &compositor_frame); |
| } |
| @@ -93,9 +95,11 @@ class CCSerializationPerfTest : public testing::Test { |
| size_t count = 0; |
| while (start < end) { |
| for (int i = 0; i < kTimeCheckInterval; ++i) { |
| + base::TimeTicks now = base::TimeTicks::Now(); |
| + if (now < end) |
| + ++count; |
| IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); |
| IPC::ParamTraits<CompositorFrame>::Write(&msg, frame); |
| - ++count; |
| } |
| base::TimeTicks now = base::TimeTicks::Now(); |
| @@ -128,9 +132,11 @@ class CCSerializationPerfTest : public testing::Test { |
| size_t count = 0; |
| while (start < end) { |
| for (int i = 0; i < kTimeCheckInterval; ++i) { |
|
danakj
2016/07/29 22:04:56
Just decrease kTimeCheckInterval for those tests a
yzshen1
2016/07/29 22:12:12
Decreasing the number of kTimeCheckInterval may af
danakj
2016/07/29 22:14:02
Ah ok.
|
| + base::TimeTicks now = base::TimeTicks::Now(); |
| + if (now < end) |
| + ++count; |
|
danakj
2016/07/29 22:14:02
Can you do this at the bottom of the loop. And you
yzshen1
2016/07/31 06:57:17
Done.
|
| CompositorFrame compositor_frame; |
| mojom::CompositorFrame::Deserialize(data, &compositor_frame); |
| - ++count; |
| } |
| base::TimeTicks now = base::TimeTicks::Now(); |
| @@ -162,9 +168,11 @@ class CCSerializationPerfTest : public testing::Test { |
| size_t count = 0; |
| while (start < end) { |
| for (int i = 0; i < kTimeCheckInterval; ++i) { |
| + base::TimeTicks now = base::TimeTicks::Now(); |
| + if (now < end) |
| + ++count; |
| mojo::Array<uint8_t> data = mojom::CompositorFrame::Serialize(&frame); |
| DCHECK_GT(data.size(), 0u); |
| - ++count; |
| } |
| base::TimeTicks now = base::TimeTicks::Now(); |