| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/benchmark_test.h" | 5 #include "vm/benchmark_test.h" |
| 6 | 6 |
| 7 #include "bin/builtin.h" | 7 #include "bin/builtin.h" |
| 8 #include "bin/file.h" | 8 #include "bin/file.h" |
| 9 | 9 |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 // | 56 // |
| 57 // Measure creation of core isolate from a snapshot. | 57 // Measure creation of core isolate from a snapshot. |
| 58 // | 58 // |
| 59 BENCHMARK(CorelibIsolateStartup) { | 59 BENCHMARK(CorelibIsolateStartup) { |
| 60 const int kNumIterations = 1000; | 60 const int kNumIterations = 1000; |
| 61 Timer timer(true, "CorelibIsolateStartup"); | 61 Timer timer(true, "CorelibIsolateStartup"); |
| 62 Isolate* isolate = Isolate::Current(); | 62 Isolate* isolate = Isolate::Current(); |
| 63 Thread::ExitIsolate(); |
| 63 for (int i = 0; i < kNumIterations; i++) { | 64 for (int i = 0; i < kNumIterations; i++) { |
| 64 timer.Start(); | 65 timer.Start(); |
| 65 TestCase::CreateTestIsolate(); | 66 TestCase::CreateTestIsolate(); |
| 66 timer.Stop(); | 67 timer.Stop(); |
| 67 Dart_ShutdownIsolate(); | 68 Dart_ShutdownIsolate(); |
| 68 } | 69 } |
| 69 benchmark->set_score(timer.TotalElapsedTime() / kNumIterations); | 70 benchmark->set_score(timer.TotalElapsedTime() / kNumIterations); |
| 70 Thread::EnterIsolate(isolate); | 71 Thread::EnterIsolate(isolate); |
| 71 } | 72 } |
| 72 | 73 |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 zone.GetZone()); | 595 zone.GetZone()); |
| 595 reader.ReadObject(); | 596 reader.ReadObject(); |
| 596 free(buffer); | 597 free(buffer); |
| 597 } | 598 } |
| 598 timer.Stop(); | 599 timer.Stop(); |
| 599 int64_t elapsed_time = timer.TotalElapsedTime(); | 600 int64_t elapsed_time = timer.TotalElapsedTime(); |
| 600 benchmark->set_score(elapsed_time); | 601 benchmark->set_score(elapsed_time); |
| 601 } | 602 } |
| 602 | 603 |
| 603 } // namespace dart | 604 } // namespace dart |
| OLD | NEW |