Index: vm/benchmark_test.cc |
=================================================================== |
--- vm/benchmark_test.cc (revision 9536) |
+++ vm/benchmark_test.cc (working copy) |
@@ -173,14 +173,21 @@ |
1); |
EXPECT(!Dart_IsError(result)); |
- Timer timer(true, "UseDartApi benchmark"); |
- timer.Start(); |
Dart_Handle args[1]; |
args[0] = Dart_NewInteger(kNumIterations); |
+ |
+ // Warmup first to avoid compilation jitters. |
Dart_Invoke(lib, |
Dart_NewString("benchmark"), |
1, |
args); |
+ |
+ Timer timer(true, "UseDartApi benchmark"); |
+ timer.Start(); |
+ Dart_Invoke(lib, |
+ Dart_NewString("benchmark"), |
+ 1, |
+ args); |
timer.Stop(); |
int64_t elapsed_time = timer.TotalElapsedTime(); |
benchmark->set_score(elapsed_time); |