skia2/tools/skpbench
Adlai Holler 79426194de Pipe ReducedOpsTaskSplitting into skpbench.py
This ought to help!

Bug: skia:10877
Change-Id: I8265c26dc4146ab78c125f27b533915cfb61aae8
Cq-Include-Trybots: luci.skia.skia.primary:Perf-Android-Clang-Pixel4XL-GPU-Adreno640-arm64-Release-All-Android_Vulkan_ReduceOpsTaskSplitting_Skpbench,Perf-Android-Clang-Pixel4XL-GPU-Adreno640-arm64-Release-All-Android_ReduceOpsTaskSplitting_Skpbench,Test-Debian10-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-ASAN_ReduceOpsTaskSplitting_Vulkan
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369756
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-02-12 19:32:02 +00:00
..
__init__.py skpbench 2016-09-19 11:03:58 -07:00
_adb_path.py Assert there are some sources when running skpbench 2019-09-11 20:20:33 +00:00
_adb.py skpbench: invoke 'adb wait-for-device' lazily 2019-07-29 16:49:59 +00:00
_benchresult.py skpbench: add "resultsfile" option 2016-11-10 16:08:12 +00:00
_hardware_android.py Skpbench: perform core locking functionality into generic hardware profile 2021-02-03 16:40:19 +00:00
_hardware_nexus_6p.py [skpbench] experiment with not disabling services 2018-03-01 19:28:44 +00:00
_hardware_pixel2.py skpbench: Add support for Pixel 2 2018-04-30 15:29:13 +00:00
_hardware_pixel_c.py [skpbench] Use android's perf settings for Pixel C 2018-03-19 14:22:55 +00:00
_hardware_pixel.py skpbench: Add support for Pixel 2 2018-04-30 15:29:13 +00:00
_hardware.py skpbench: support pixel phone 2017-10-20 17:52:36 +00:00
_os_path.py Add "AllPathsVolatile" skpbench bots 2020-09-24 19:50:34 +00:00
README.md Skpbench: perform core locking functionality into generic hardware profile 2021-02-03 16:40:19 +00:00
sheet.py skpbench: add utility to format results for Skia Perf 2016-11-10 20:00:56 +00:00
skiaperf.py find min and max, separared by comma. not minmax. 2019-11-06 16:35:23 +00:00
skpbench.cpp Performance experiment: Disable SkSL optimization in nanobench/skpbench 2021-02-12 16:02:25 +00:00
skpbench.py Pipe ReducedOpsTaskSplitting into skpbench.py 2021-02-12 19:32:02 +00:00

skpbench

skpbench is a benchmarking tool for replaying skp or mksp files on android devices. it achieves a lower variance in framerate by controlling the clock speed and stopping all other processes that could cause interference.

Build

skpbench consists of the skpbench binary which must be built for the phone you intend to run on, and skpbench.py which runs on the machine the phone is connected to via ADB and is the entry point.

The to build skia for android are at https://skia.org/user/build#android and reproduced here.

Download the Android NDK

cipd auth-login
python2 infra/bots/assets/android_ndk_linux/download.py  -t /tmp/ndk

After this is set up once, build skpbench for your target cpu (assumed to be arm64 here for a Pixel 3)

bin/gn gen out/arm64 --args='ndk="/tmp/ndk" target_cpu="arm64" is_debug=false'
ninja -C out/arm64 skpbench

Benchmark an SKP on a connected device.

First, copy the built skpbench binary and an example skp file to the device.

adb push out/arm64/skpbench /data/local/tmp
adb push /home/nifong/Downloads/foo.skp /data/local/tmp/skps/

Run skpbench.py (in my case on a Pixel 3)

python tools/skpbench/skpbench.py \
  --adb \
  --config gles \
  /data/local/tmp/skpbench \
  /data/local/tmp/skps/foo.skp

--adb specifies that it should use adb to the only connected device and run skpbench there. --force is necessary because we don't yet have a configuration to monitor vitals on the Pixel 3. --config gles specifies Open GL ES is the backend GPU config to use.

Additional documentation of arguments is printed by python tools/skpbench/skpbench.py --help

Output appears in the following format

   accum    median       max       min   stddev  samples  sample_ms  clock  metric  config    bench
  0.1834    0.1832    0.1897    0.1707    1.59%      101         50  cpu    ms      gles      foo.skp

accum is the time taken to draw all frames, divided by the number of frames. metric specifies that the unit is ms (milliseconds per frame)

Production

skpbench is run as a tryjob from gerrit, where it uploads the results to perf.skia.org. TODO(nifong, csmartdalton): elaborate on this section.