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

Side by Side Diff: cc/ipc/cc_serialization_perftest.cc

Issue 2936723003: cc_perftests: Annotate some metrics as runs/s. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <utility> 5 #include <utility>
6 6
7 #include "base/test/launcher/unit_test_launcher.h" 7 #include "base/test/launcher/unit_test_launcher.h"
8 #include "base/test/test_suite.h" 8 #include "base/test/test_suite.h"
9 #include "cc/ipc/begin_frame_args_struct_traits.h" 9 #include "cc/ipc/begin_frame_args_struct_traits.h"
10 #include "cc/ipc/cc_param_traits.h" 10 #include "cc/ipc/cc_param_traits.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 "ParamTraits deserialization: min_frame_deserialization_time", 82 "ParamTraits deserialization: min_frame_deserialization_time",
83 single_sqs == UseSingleSharedQuadState::YES 83 single_sqs == UseSingleSharedQuadState::YES
84 ? "_per_render_pass_shared_quad_state" 84 ? "_per_render_pass_shared_quad_state"
85 : "_per_quad_shared_quad_state", 85 : "_per_quad_shared_quad_state",
86 test_name, min_time.InMillisecondsF() / kTimeCheckInterval * 1000, "us", 86 test_name, min_time.InMillisecondsF() / kTimeCheckInterval * 1000, "us",
87 true); 87 true);
88 perf_test::PrintResult("ParamTraits deserialization: num runs in 2 seconds", 88 perf_test::PrintResult("ParamTraits deserialization: num runs in 2 seconds",
89 single_sqs == UseSingleSharedQuadState::YES 89 single_sqs == UseSingleSharedQuadState::YES
90 ? "_per_render_pass_shared_quad_state" 90 ? "_per_render_pass_shared_quad_state"
91 : "_per_quad_shared_quad_state", 91 : "_per_quad_shared_quad_state",
92 test_name, count, "", true); 92 test_name, count, "runs/s", true);
93 } 93 }
94 94
95 static void RunSerializationTestParamTraits( 95 static void RunSerializationTestParamTraits(
96 const std::string& test_name, 96 const std::string& test_name,
97 const CompositorFrame& frame, 97 const CompositorFrame& frame,
98 UseSingleSharedQuadState single_sqs) { 98 UseSingleSharedQuadState single_sqs) {
99 for (int i = 0; i < kNumWarmupRuns; ++i) { 99 for (int i = 0; i < kNumWarmupRuns; ++i) {
100 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); 100 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
101 IPC::ParamTraits<CompositorFrame>::Write(&msg, frame); 101 IPC::ParamTraits<CompositorFrame>::Write(&msg, frame);
102 } 102 }
(...skipping 23 matching lines...) Expand all
126 "ParamTraits serialization: min_frame_serialization_time", 126 "ParamTraits serialization: min_frame_serialization_time",
127 single_sqs == UseSingleSharedQuadState::YES 127 single_sqs == UseSingleSharedQuadState::YES
128 ? "_per_render_pass_shared_quad_state" 128 ? "_per_render_pass_shared_quad_state"
129 : "_per_quad_shared_quad_state", 129 : "_per_quad_shared_quad_state",
130 test_name, min_time.InMillisecondsF() / kTimeCheckInterval * 1000, "us", 130 test_name, min_time.InMillisecondsF() / kTimeCheckInterval * 1000, "us",
131 true); 131 true);
132 perf_test::PrintResult("ParamTraits serialization: num runs in 2 seconds", 132 perf_test::PrintResult("ParamTraits serialization: num runs in 2 seconds",
133 single_sqs == UseSingleSharedQuadState::YES 133 single_sqs == UseSingleSharedQuadState::YES
134 ? "_per_render_pass_shared_quad_state" 134 ? "_per_render_pass_shared_quad_state"
135 : "_per_quad_shared_quad_state", 135 : "_per_quad_shared_quad_state",
136 test_name, count, "", true); 136 test_name, count, "runs/s", true);
137 } 137 }
138 138
139 static void RunDeserializationTestStructTraits( 139 static void RunDeserializationTestStructTraits(
140 const std::string& test_name, 140 const std::string& test_name,
141 const CompositorFrame& frame, 141 const CompositorFrame& frame,
142 UseSingleSharedQuadState single_sqs) { 142 UseSingleSharedQuadState single_sqs) {
143 auto data = mojom::CompositorFrame::Serialize(&frame); 143 auto data = mojom::CompositorFrame::Serialize(&frame);
144 DCHECK_GT(data.size(), 0u); 144 DCHECK_GT(data.size(), 0u);
145 for (int i = 0; i < kNumWarmupRuns; ++i) { 145 for (int i = 0; i < kNumWarmupRuns; ++i) {
146 CompositorFrame compositor_frame; 146 CompositorFrame compositor_frame;
(...skipping 26 matching lines...) Expand all
173 single_sqs == UseSingleSharedQuadState::YES 173 single_sqs == UseSingleSharedQuadState::YES
174 ? "_per_render_pass_shared_quad_state" 174 ? "_per_render_pass_shared_quad_state"
175 : "_per_quad_shared_quad_state", 175 : "_per_quad_shared_quad_state",
176 test_name, min_time.InMillisecondsF() / kTimeCheckInterval * 1000, "us", 176 test_name, min_time.InMillisecondsF() / kTimeCheckInterval * 1000, "us",
177 true); 177 true);
178 perf_test::PrintResult( 178 perf_test::PrintResult(
179 "StructTraits deserialization: num runs in 2 seconds", 179 "StructTraits deserialization: num runs in 2 seconds",
180 single_sqs == UseSingleSharedQuadState::YES 180 single_sqs == UseSingleSharedQuadState::YES
181 ? "_per_render_pass_shared_quad_state" 181 ? "_per_render_pass_shared_quad_state"
182 : "_per_quad_shared_quad_state", 182 : "_per_quad_shared_quad_state",
183 test_name, count, "", true); 183 test_name, count, "runs/s", true);
184 } 184 }
185 185
186 static void RunSerializationTestStructTraits( 186 static void RunSerializationTestStructTraits(
187 const std::string& test_name, 187 const std::string& test_name,
188 const CompositorFrame& frame, 188 const CompositorFrame& frame,
189 UseSingleSharedQuadState single_sqs) { 189 UseSingleSharedQuadState single_sqs) {
190 for (int i = 0; i < kNumWarmupRuns; ++i) { 190 for (int i = 0; i < kNumWarmupRuns; ++i) {
191 auto data = mojom::CompositorFrame::Serialize(&frame); 191 auto data = mojom::CompositorFrame::Serialize(&frame);
192 DCHECK_GT(data.size(), 0u); 192 DCHECK_GT(data.size(), 0u);
193 } 193 }
(...skipping 23 matching lines...) Expand all
217 "StructTraits serialization min_frame_serialization_time", 217 "StructTraits serialization min_frame_serialization_time",
218 single_sqs == UseSingleSharedQuadState::YES 218 single_sqs == UseSingleSharedQuadState::YES
219 ? "_per_render_pass_shared_quad_state" 219 ? "_per_render_pass_shared_quad_state"
220 : "_per_quad_shared_quad_state", 220 : "_per_quad_shared_quad_state",
221 test_name, min_time.InMillisecondsF() / kTimeCheckInterval * 1000, "us", 221 test_name, min_time.InMillisecondsF() / kTimeCheckInterval * 1000, "us",
222 true); 222 true);
223 perf_test::PrintResult("StructTraits serialization: num runs in 2 seconds", 223 perf_test::PrintResult("StructTraits serialization: num runs in 2 seconds",
224 single_sqs == UseSingleSharedQuadState::YES 224 single_sqs == UseSingleSharedQuadState::YES
225 ? "_per_render_pass_shared_quad_state" 225 ? "_per_render_pass_shared_quad_state"
226 : "_per_quad_shared_quad_state", 226 : "_per_quad_shared_quad_state",
227 test_name, count, "", true); 227 test_name, count, "runs/s", true);
228 } 228 }
229 229
230 static void RunComplexCompositorFrameTest(const std::string& test_name) { 230 static void RunComplexCompositorFrameTest(const std::string& test_name) {
231 CompositorFrame frame; 231 CompositorFrame frame;
232 232
233 TransferableResourceArray& resource_list = frame.resource_list; 233 TransferableResourceArray& resource_list = frame.resource_list;
234 for (uint32_t i = 0; i < 80; ++i) { 234 for (uint32_t i = 0; i < 80; ++i) {
235 TransferableResource arbitrary_resource; 235 TransferableResource arbitrary_resource;
236 resource_list.push_back(arbitrary_resource); 236 resource_list.push_back(arbitrary_resource);
237 } 237 }
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 // Case 1: One shared quad state for all quads in one render pass. 459 // Case 1: One shared quad state for all quads in one render pass.
460 RunCompositorFrameTest("DelegatedFrame_ManyRenderPasses_10_500", 500, 10, 460 RunCompositorFrameTest("DelegatedFrame_ManyRenderPasses_10_500", 500, 10,
461 UseSingleSharedQuadState::YES); 461 UseSingleSharedQuadState::YES);
462 // Case 2: One shared quad state for each quad. 462 // Case 2: One shared quad state for each quad.
463 RunCompositorFrameTest("DelegatedFrame_ManyRenderPasses_10_500", 500, 10, 463 RunCompositorFrameTest("DelegatedFrame_ManyRenderPasses_10_500", 500, 10,
464 UseSingleSharedQuadState::NO); 464 UseSingleSharedQuadState::NO);
465 } 465 }
466 466
467 } // namespace 467 } // namespace
468 } // namespace cc 468 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698