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

Unified Diff: bench/nanobench.cpp

Issue 1493313003: simplify nanobench --quiet / -q output (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 602d6137ca77c1332faeebbb1a4665d57e424615..a4453f90c1b8a55fcb1fb6817930bd8f5e704889 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -1131,7 +1131,8 @@ int nanobench_main() {
if (kAutoTuneLoops != FLAGS_loops) {
SkDebugf("Fixed number of loops; times would only be misleading so we won't print them.\n");
} else if (FLAGS_quiet) {
- SkDebugf("median\tbench\tconfig\n");
+ SkDebugf("! -> high variance, ? -> moderate variance\n");
+ SkDebugf(" micros \tbench\n");
} else if (FLAGS_ms) {
SkDebugf("curr/maxrss\tloops\tmin\tmedian\tmean\tmax\tstddev\tsamples\tconfig\tbench\n");
} else {
@@ -1241,10 +1242,13 @@ int nanobench_main() {
, bench->getUniqueName()
, config);
} else if (FLAGS_quiet) {
- if (configs.count() == 1) {
- config = ""; // Only print the config if we run the same bench on more than one.
- }
- SkDebugf("%s\t%s\t%s\n", HUMANIZE(stats.median), bench->getUniqueName(), config);
+ const char* mark = " ";
+ const double stddev_percent = 100 * sqrt(stats.var) / stats.mean;
+ if (stddev_percent > 5) mark = "?";
+ if (stddev_percent > 10) mark = "!";
+
+ SkDebugf("%10.2f %s\t%s\t%s\n",
+ stats.median*1e3, mark, bench->getUniqueName(), config);
} else {
const double stddev_percent = 100 * sqrt(stats.var) / stats.mean;
SkDebugf("%4d/%-4dMB\t%d\t%s\t%s\t%s\t%s\t%.0f%%\t%s\t%s\t%s\n"
« 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