From fd731ce804cd3223318f3feee2c98404890b65f2 Mon Sep 17 00:00:00 2001 From: mtklein Date: Wed, 10 Sep 2014 12:19:30 -0700 Subject: Measure picture recording speed in nanobench. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- bench/RecordingBench.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 bench/RecordingBench.h (limited to 'bench/RecordingBench.h') 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 fSrc; + SkString fName; + bool fUseBBH; + + typedef Benchmark INHERITED; +}; + +#endif//RecordingBench_DEFINED -- cgit v1.2.3