aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/nanobench.cpp
diff options
context:
space:
mode:
authorGravatar Leon Scroggins III <scroggo@google.com>2017-10-02 09:48:15 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-02 20:37:00 +0000
commitb30d11319bac8bb7a528b6da5ddd13ac9db26996 (patch)
tree762e483207e742adf2bf5fc0f42429a8c9cec311 /bench/nanobench.cpp
parent29f642a95205b5cdd82e50ab420ec858c3ceffe6 (diff)
Do not try to time kFailedLoops
Move the check for kFailedLoops above code that times the benchmark. This matches the comment ("Can't be timed") and prevents an infinite loop. Bug: skia:6774 Change-Id: Iacdc1ca1d11afcf05afac60e4eb0d8d9a12f800e Reviewed-on: https://skia-review.googlesource.com/53803 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'bench/nanobench.cpp')
-rw-r--r--bench/nanobench.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 04583309ce..61de8a944e 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -1284,6 +1284,12 @@ int main(int argc, char** argv) {
? setup_gpu_bench(target, bench.get(), maxFrameLag)
: setup_cpu_bench(overhead, target, bench.get());
+ if (kFailedLoops == loops) {
+ // Can't be timed. A warning note has already been printed.
+ cleanup_run(target);
+ continue;
+ }
+
if (runs == 0 && FLAGS_ms < 1000) {
// Run the first bench for 1000ms to warm up the nanobench if FLAGS_ms < 1000.
// Otherwise, the first few benches' measurements will be inaccurate.
@@ -1326,12 +1332,6 @@ int main(int argc, char** argv) {
write_canvas_png(target, pngFilename);
}
- if (kFailedLoops == loops) {
- // Can't be timed. A warning note has already been printed.
- cleanup_run(target);
- continue;
- }
-
Stats stats(samples);
log->config(config);
log->configOption("name", bench->getName());