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

Unified Diff: bench/nanobench.cpp

Issue 653083003: nanobench: flush after recording every Nth data point. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: --flushEvery Created 6 years, 2 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 | « bench/ResultsWriter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index d06d75358d0a56831065f4ca1f22099549929b40..250f438d6ac4e31c8f8f0941e0e1dfa7710640dc 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -70,6 +70,7 @@ DEFINE_int32(maxLoops, 1000000, "Never run a bench more times than this.");
DEFINE_string(clip, "0,0,1000,1000", "Clip for SKPs.");
DEFINE_string(scales, "1.0", "Space-separated scales for SKPs.");
DEFINE_bool(bbh, true, "Build a BBH for SKPs?");
+DEFINE_int32(flushEvery, 10, "Flush --outResultsFile every Nth run.");
static SkString humanize(double ms) {
if (FLAGS_verbose) return SkStringPrintf("%llu", (uint64_t)(ms*1e6));
@@ -628,6 +629,7 @@ int nanobench_main() {
SkTDArray<Config> configs;
create_configs(&configs);
+ int runs = 0;
BenchmarkStream benchStream;
while (Benchmark* b = benchStream.next()) {
SkAutoTDelete<Benchmark> bench(b);
@@ -680,6 +682,9 @@ int nanobench_main() {
log->timer("mean_ms", stats.mean);
log->timer("max_ms", stats.max);
log->timer("stddev_ms", sqrt(stats.var));
+ if (runs++ % FLAGS_flushEvery == 0) {
+ log->flush();
+ }
if (kAutoTuneLoops != FLAGS_loops) {
if (targets.count() == 1) {
« no previous file with comments | « bench/ResultsWriter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698