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

Side by Side Diff: components/tracing/test/trace_event_perftest.cc

Issue 2656303003: Test virtual interface [NOT FOR REVIEW] (Closed)
Patch Set: results Created 3 years, 10 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/memory/ptr_util.h" 6 #include "base/memory/ptr_util.h"
7 #include "base/memory/ref_counted_memory.h" 7 #include "base/memory/ref_counted_memory.h"
8 #include "base/pending_task.h" 8 #include "base/pending_task.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
11 #include "base/trace_event/trace_event.h" 11 #include "base/trace_event/trace_event.h"
12 #include "base/trace_event/trace_event_argument.h" 12 #include "base/trace_event/trace_event_argument.h"
13 #include "perf_test_helpers.h" 13 #include "perf_test_helpers.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 #include "tracing_interface_simulator.h"
15 16
16 namespace tracing { 17 namespace tracing {
17 namespace { 18 namespace {
18 19
19 using base::Bind; 20 using base::Bind;
20 using base::Closure; 21 using base::Closure;
21 using base::RunLoop; 22 using base::RunLoop;
22 using base::Thread; 23 using base::Thread;
23 using base::Unretained; 24 using base::Unretained;
24 using base::WaitableEvent; 25 using base::WaitableEvent;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 task_sw.NextLap(); 181 task_sw.NextLap();
181 } 182 }
182 EndTraceAndFlush(); 183 EndTraceAndFlush();
183 } 184 }
184 185
185 TEST_F(TraceEventPerfTest, Submit_10000_TRACE_EVENT0_with_tracing_disabled) { 186 TEST_F(TraceEventPerfTest, Submit_10000_TRACE_EVENT0_with_tracing_disabled) {
186 ScopedStopwatch stopwatch("events"); 187 ScopedStopwatch stopwatch("events");
187 SubmitTraceEvents(10000); 188 SubmitTraceEvents(10000);
188 } 189 }
189 190
191 TEST_F(TraceEventPerfTest, Submit_50000_TRACE_EVENT_TEST_via_virtual_calls) {
192 BeginTrace();
193 InitTracingInterface();
194 IterableStopwatch stopwatch("events");
195 for (int lap = 0; lap < kNumRuns; lap++) {
196 for (int i = 0; i < 50000; i++) {
197 TRACE_EVENT_VIRTUAL_TEST("test_category", "test call");
198 }
199 stopwatch.NextLap();
200 }
201 EndTraceAndFlush();
202 }
203
204 TEST_F(TraceEventPerfTest, Submit_50000_TRACE_EVENT_TEST_via_direct_calls) {
205 BeginTrace();
206 IterableStopwatch stopwatch("events");
207 for (int lap = 0; lap < kNumRuns; lap++) {
208 for (int i = 0; i < 50000; i++) {
209 TRACE_EVENT_DIRECT_TEST("test_category", "test call");
210 }
211 stopwatch.NextLap();
212 }
213 EndTraceAndFlush();
214 }
215
190 } // namespace 216 } // namespace
191 } // namespace tracing 217 } // namespace tracing
OLDNEW
« no previous file with comments | « components/tracing/test/results_nexus5.txt ('k') | components/tracing/test/tracing_interface_simulator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698