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

Unified Diff: benchmark/lib/suite.dart

Issue 1330723003: Implement a better dashboard for running benchmarks (Closed) Base URL: git@github.com:dart-lang/dart-protoc-plugin.git@master
Patch Set: Created 5 years, 3 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
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");
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698