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

Unified Diff: runtime/vm/benchmark_test.cc

Issue 128653004: Use list of isolates in profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/dart.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/benchmark_test.cc
diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc
index 62c04de02ec2802ce618e576756839cac7e150b9..94d8baf011a7e821c580c5f42308ca2693ff197f 100644
--- a/runtime/vm/benchmark_test.cc
+++ b/runtime/vm/benchmark_test.cc
@@ -482,4 +482,24 @@ BENCHMARK(CreateMirrorSystem) {
benchmark->set_score(elapsed_time);
}
+
+BENCHMARK(EnterExitIsolate) {
+ const char* kScriptChars =
+ "import 'dart:core';\n"
+ "\n";
+ const intptr_t kLoopCount = 1000000;
+ TestCase::LoadTestScript(kScriptChars, NULL);
+ Api::CheckIsolateState(Isolate::Current());
+ Dart_Isolate isolate = Dart_CurrentIsolate();
+ Timer timer(true, "Enter and Exit isolate");
+ timer.Start();
+ for (intptr_t i = 0; i < kLoopCount; i++) {
+ Dart_ExitIsolate();
+ Dart_EnterIsolate(isolate);
+ }
+ timer.Stop();
+ int64_t elapsed_time = timer.TotalElapsedTime();
+ benchmark->set_score(elapsed_time);
+}
+
} // namespace dart
« no previous file with comments | « no previous file | runtime/vm/dart.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698