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

Unified Diff: runtime/vm/benchmark_test.cc

Issue 20147002: Add a VM benchmark for creating the local MirrorSystem. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 25435)
+++ runtime/vm/benchmark_test.cc (working copy)
@@ -455,4 +455,24 @@
benchmark->set_score(snapshot->length());
}
+
+BENCHMARK(CreateMirrorSystem) {
+ const char* kScriptChars =
+ "import 'dart:mirrors';\n"
+ "\n"
+ "void benchmark() {\n"
+ " currentMirrorSystem();\n"
+ "}\n";
+
+ Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
+ Dart_Handle args[0];
+
+ Timer timer(true, "currentMirrorSystem() benchmark");
+ timer.Start();
+ Dart_Invoke(lib, NewString("benchmark"), 0, args);
+ timer.Stop();
+ int64_t elapsed_time = timer.TotalElapsedTime();
+ benchmark->set_score(elapsed_time);
+}
+
} // namespace dart
« 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