OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ipc/ipc_perftest_support.h" | 5 #include "ipc/ipc_perftest_support.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 std::string payload_; | 222 std::string payload_; |
223 EventTimeTracker latency_tracker_; | 223 EventTimeTracker latency_tracker_; |
224 scoped_ptr<base::PerfTimeLogger> perf_logger_; | 224 scoped_ptr<base::PerfTimeLogger> perf_logger_; |
225 }; | 225 }; |
226 | 226 |
227 std::vector<PingPongTestParams> | 227 std::vector<PingPongTestParams> |
228 IPCChannelPerfTestBase::GetDefaultTestParams() { | 228 IPCChannelPerfTestBase::GetDefaultTestParams() { |
229 // Test several sizes. We use 12^N for message size, and limit the message | 229 // Test several sizes. We use 12^N for message size, and limit the message |
230 // count to keep the test duration reasonable. | 230 // count to keep the test duration reasonable. |
231 std::vector<PingPongTestParams> list; | 231 std::vector<PingPongTestParams> list; |
| 232 #if 0 |
232 list.push_back(PingPongTestParams(12, 50000)); | 233 list.push_back(PingPongTestParams(12, 50000)); |
233 list.push_back(PingPongTestParams(144, 50000)); | 234 list.push_back(PingPongTestParams(144, 50000)); |
234 list.push_back(PingPongTestParams(1728, 50000)); | 235 list.push_back(PingPongTestParams(1728, 50000)); |
235 list.push_back(PingPongTestParams(20736, 12000)); | 236 list.push_back(PingPongTestParams(20736, 12000)); |
236 list.push_back(PingPongTestParams(248832, 1000)); | 237 list.push_back(PingPongTestParams(248832, 1000)); |
| 238 #else |
| 239 // list.push_back(PingPongTestParams(12, 1000000)); |
| 240 list.push_back(PingPongTestParams(12, 1000000)); |
| 241 #endif |
237 return list; | 242 return list; |
238 } | 243 } |
239 | 244 |
240 void IPCChannelPerfTestBase::RunTestChannelPingPong( | 245 void IPCChannelPerfTestBase::RunTestChannelPingPong( |
241 const std::vector<PingPongTestParams>& params) { | 246 const std::vector<PingPongTestParams>& params) { |
242 Init("PerformanceClient"); | 247 Init("PerformanceClient"); |
243 | 248 |
244 // Set up IPC channel and start client. | 249 // Set up IPC channel and start client. |
245 PerformanceChannelListener listener("Channel"); | 250 PerformanceChannelListener listener("Channel"); |
246 CreateChannel(&listener); | 251 CreateChannel(&listener); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 auto set_result = SetThreadAffinityMask(GetCurrentThread(), old_affinity_); | 377 auto set_result = SetThreadAffinityMask(GetCurrentThread(), old_affinity_); |
373 DCHECK_NE(0u, set_result); | 378 DCHECK_NE(0u, set_result); |
374 #elif defined(OS_LINUX) | 379 #elif defined(OS_LINUX) |
375 auto set_result = sched_setaffinity(0, sizeof(old_cpuset_), &old_cpuset_); | 380 auto set_result = sched_setaffinity(0, sizeof(old_cpuset_), &old_cpuset_); |
376 DCHECK_EQ(0, set_result); | 381 DCHECK_EQ(0, set_result); |
377 #endif | 382 #endif |
378 } | 383 } |
379 | 384 |
380 } // namespace test | 385 } // namespace test |
381 } // namespace IPC | 386 } // namespace IPC |
OLD | NEW |