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

Unified Diff: runtime/vm/benchmark_test.cc

Issue 319833004: Simplifies CorelibIsolateStartup benchmark, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/benchmark_test.cc
===================================================================
--- runtime/vm/benchmark_test.cc (revision 37052)
+++ runtime/vm/benchmark_test.cc (working copy)
@@ -57,33 +57,17 @@
// Measure creation of core isolate from a snapshot.
//
BENCHMARK(CorelibIsolateStartup) {
- const int kNumIterations = 100;
- char* err = NULL;
- Dart_Isolate base_isolate = Dart_CurrentIsolate();
- Dart_Isolate test_isolate = Dart_CreateIsolate(NULL, NULL,
- bin::snapshot_buffer,
- NULL, &err);
- EXPECT(test_isolate != NULL);
- Dart_EnterScope();
- uint8_t* buffer = NULL;
- intptr_t size = 0;
- Dart_Handle result = Dart_CreateSnapshot(&buffer, &size);
- EXPECT_VALID(result);
- Timer timer(true, "Core Isolate startup benchmark");
- timer.Start();
+ const int kNumIterations = 1000;
+ Timer timer(true, "CorelibIsolateStartup");
+ Isolate* isolate = Isolate::Current();
for (int i = 0; i < kNumIterations; i++) {
- Dart_Isolate new_isolate =
- Dart_CreateIsolate(NULL, NULL, buffer, NULL, &err);
- EXPECT(new_isolate != NULL);
+ timer.Start();
+ TestCase::CreateTestIsolate();
+ timer.Stop();
Dart_ShutdownIsolate();
}
- timer.Stop();
- int64_t elapsed_time = timer.TotalElapsedTime();
- benchmark->set_score(elapsed_time / kNumIterations);
- Dart_EnterIsolate(test_isolate);
- Dart_ExitScope();
- Dart_ShutdownIsolate();
- Dart_EnterIsolate(base_isolate);
+ benchmark->set_score(timer.TotalElapsedTime() / kNumIterations);
+ Isolate::SetCurrent(isolate);
}
« 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