Index: benchmark/lib/suite.dart |
diff --git a/benchmark/lib/suite.dart b/benchmark/lib/suite.dart |
index 1ef9ec4534259b5fb5e653a73e024d5f394e832f..73a1244e2c8dfb7a6760b6ae95cff3e65393463d 100644 |
--- a/benchmark/lib/suite.dart |
+++ b/benchmark/lib/suite.dart |
@@ -34,21 +34,29 @@ Iterable<pb.Report> runSuite(pb.Suite suite) sync* { |
// Send first progress message before starting. |
yield progress(); |
- // Fill in each response. |
+ var benchmarks = <Benchmark>[]; |
for (var r in report.responses) { |
- var b = createBenchmark(r.request); |
+ benchmarks.add(createBenchmark(r.request)); |
+ } |
+ |
+ // Collect the requested number of samples. |
+ while (sampleCount < totalSamples) { |
+ for (var i = 0; i < benchmarks.length; i++) { |
+ var b = benchmarks[i]; |
+ var r = report.responses[i]; |
+ if (r.samples.length == r.request.samples) continue; |
- // Run the benchmark the requested number of times. |
- for (pb.Sample s in b.measure(r.request)) { |
- r.samples.add(s); |
- sampleCount++; |
- yield progress(); |
+ for (pb.Sample s in b.measure(r.request, 1)) { |
+ r.samples.add(s); |
+ sampleCount++; |
+ yield progress(); |
- // Also send progress to the console. |
- int usecsPerLoop = s.duration ~/ s.loopCount; |
- int kIntReadsPerSecond = s.counts.int32Reads * 1000 ~/ s.duration; |
- print("${b.summary} time: $usecsPerLoop us," |
- " throughput: ${kIntReadsPerSecond}k int32 reads/sec"); |
+ // Also send progress to the console. |
+ int usecsPerLoop = s.duration ~/ s.loopCount; |
+ int kIntReadsPerSecond = s.counts.int32Reads * 1000 ~/ s.duration; |
+ print("${b.summary} time: $usecsPerLoop us," |
+ " throughput: ${kIntReadsPerSecond}k int32 reads/sec"); |
+ } |
} |
} |