aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/RecordingBench.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-09-10 12:19:30 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-10 12:19:30 -0700
commitfd731ce804cd3223318f3feee2c98404890b65f2 (patch)
treea0d8da69bff1916ff480fa98e0e3f2a5aef7cb7a /bench/RecordingBench.h
parent33bce0a68bf24696f35b6ce102e6eed2873b69a4 (diff)
Measure picture recording speed in nanobench.
Today we measure SkPicture playback speed, but not the time it takes to record the SkPicture. This fixes that by reading SKPs from disk and re-recording them. On the console, recording shows up first as the nonrendering skp benches, followed later by the usual playback benches: maxrss loops min median mean max stddev samples config bench 51M 2 165µs 168µs 169µs 178µs 3% ▆▄▃█▂▄▁▂▁▁ nonrendering tabl_slashdot.skp 57M 1 9.72ms 9.77ms 9.79ms 9.97ms 1% █▂▂▅▃▂▁▄▂▁ nonrendering desk_pokemonwiki.skp 57M 32 2.92µs 2.96µs 3.03µs 3.46µs 6% ▅▁▁▁▁▁▁█▂▁ nonrendering desk_yahoosports.skp ... 147M 1 3.86ms 3.87ms 3.97ms 4.81ms 7% █▁▁▁▁▁▁▁▁▁ 8888 tabl_slashdot.skp_1 147M 1 4.54ms 4.56ms 4.55ms 4.56ms 0% █▅▇▅█▅▂▁▅▁ 565 tabl_slashdot.skp_1 147M 2 3.08ms 3.24ms 4.17ms 8.18ms 50% █▁▁█▁▁▁▁▁▁ gpu tabl_slashdot.skp_1 147M 1 1.61ms 1.62ms 1.69ms 2.33ms 13% █▁▁▁▁▁▁▁▁▁ 8888 desk_pokemonwiki.skp_1 147M 1 1.44ms 1.44ms 1.45ms 1.47ms 1% ▅▂█▂▂▅▁▁▂▁ 565 desk_pokemonwiki.skp_1 ... On skiaperf.com, they'll also be separated out from playback benches by bench_type. BUG=skia: R=reed@google.com, mtklein@google.com, jcgregorio@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/559153002
Diffstat (limited to 'bench/RecordingBench.h')
-rw-r--r--bench/RecordingBench.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/bench/RecordingBench.h b/bench/RecordingBench.h
new file mode 100644
index 0000000000..4c0340127c
--- /dev/null
+++ b/bench/RecordingBench.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef RecordingBench_DEFINED
+#define RecordingBench_DEFINED
+
+#include "Benchmark.h"
+#include "SkPicture.h"
+
+class RecordingBench : public Benchmark {
+public:
+ RecordingBench(const char* name, const SkPicture*, bool useBBH);
+
+protected:
+ virtual const char* onGetName() SK_OVERRIDE;
+ virtual bool isSuitableFor(Backend) SK_OVERRIDE;
+ virtual void onDraw(const int loops, SkCanvas*) SK_OVERRIDE;
+ virtual SkIPoint onGetSize() SK_OVERRIDE;
+
+private:
+ SkAutoTUnref<const SkPicture> fSrc;
+ SkString fName;
+ bool fUseBBH;
+
+ typedef Benchmark INHERITED;
+};
+
+#endif//RecordingBench_DEFINED