| OLD | NEW |
| 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 // This tests the performance of the C API. | 5 // This tests the performance of the C API. |
| 6 | 6 |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <stdio.h> | 9 #include <stdio.h> |
| 10 #include <time.h> | 10 #include <time.h> |
| 11 | 11 |
| 12 #include <functional> | 12 #include <functional> |
| 13 #include <thread> | 13 #include <thread> |
| 14 | 14 |
| 15 #include "mojo/public/c/system/functions.h" | |
| 16 #include "mojo/public/c/system/handle.h" | 15 #include "mojo/public/c/system/handle.h" |
| 17 #include "mojo/public/c/system/message_pipe.h" | 16 #include "mojo/public/c/system/message_pipe.h" |
| 18 #include "mojo/public/c/system/result.h" | 17 #include "mojo/public/c/system/result.h" |
| 19 #include "mojo/public/c/system/types.h" | 18 #include "mojo/public/c/system/time.h" |
| 19 #include "mojo/public/c/system/wait.h" |
| 20 #include "mojo/public/cpp/system/macros.h" | 20 #include "mojo/public/cpp/system/macros.h" |
| 21 #include "mojo/public/cpp/test_support/test_support.h" | 21 #include "mojo/public/cpp/test_support/test_support.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 using PerfTestSingleIteration = std::function<void()>; | 26 using PerfTestSingleIteration = std::function<void()>; |
| 27 | 27 |
| 28 void IterateAndReportPerf(const char* test_name, | 28 void IterateAndReportPerf(const char* test_name, |
| 29 const char* sub_test_name, | 29 const char* sub_test_name, |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 DoMessagePipeThreadedTest(1u, 1u, 10000u); | 343 DoMessagePipeThreadedTest(1u, 1u, 10000u); |
| 344 | 344 |
| 345 DoMessagePipeThreadedTest(3u, 3u, 10u); | 345 DoMessagePipeThreadedTest(3u, 3u, 10u); |
| 346 // 100 was done above. | 346 // 100 was done above. |
| 347 DoMessagePipeThreadedTest(3u, 3u, 1000u); | 347 DoMessagePipeThreadedTest(3u, 3u, 1000u); |
| 348 DoMessagePipeThreadedTest(3u, 3u, 10000u); | 348 DoMessagePipeThreadedTest(3u, 3u, 10000u); |
| 349 } | 349 } |
| 350 #endif // !defined(WIN32) | 350 #endif // !defined(WIN32) |
| 351 | 351 |
| 352 } // namespace | 352 } // namespace |
| OLD | NEW |