2 # Copyright 2020 Google LLC
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 # This script measures frametimes for CanvasKit rendering all skps in ~/skps, using puppeteer. It
8 # can optionally output a human-readable summary of the collected measurements.
9 # See the document "SIMD CanvasKit Build Performance Testing" for results and context:
10 # https://docs.google.com/document/d/114kdSGPMnOSQCZ7pFgd3MGMn5mIW562RMoXVmD13e0M/edit?ts=5f0eedf6#
13 # --release perfs the release build of CanvasKit and outputs data to release_out.json
14 # --simd perfs the experimental_simd build of CanvasKit outputs data to simd_out.json
15 # --summary outputs results from the perfs in a human readable table format.
17 # example usage: ./perf_all_skps.sh --release --simd --summary
19 for f in $HOME/skps/*.skp;
21 if [[ "$*" == *"--release"* ]]
24 node perf-canvaskit-with-puppeteer.js \
25 --canvaskit_js ../../out/canvaskit_wasm/canvaskit.js \
26 --canvaskit_wasm ../../out/canvaskit_wasm/canvaskit.wasm --use_gpu \
28 --bench_html render-skp.html \
29 --chromium_executable_path "/applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary" \
30 --output release_out.json \
31 --merge_output_as `basename $f`
33 if [[ "$*" == *"--simd"* ]]
35 node perf-canvaskit-with-puppeteer.js \
36 --canvaskit_js ../../out/canvaskit_wasm_experimental_simd/canvaskit.js \
37 --canvaskit_wasm ../../out/canvaskit_wasm_experimental_simd/canvaskit.wasm --use_gpu \
39 --bench_html render-skp.html \
40 --chromium_executable_path "/applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary" \
42 --output simd_out.json \
43 --merge_output_as `basename $f`
46 if [[ "$*" == *"--summary"* ]]