• Home
Name Date Size #Lines LOC

..--

canvas_perf_assets/12-May-2024-

path_translate_assets/12-May-2024-5,1565,154

MakefileD12-May-20241.2 KiB2923

README.mdD12-May-20242.9 KiB5644

benchmark.jsD12-May-20243.8 KiB10781

canvas_perf.htmlD12-May-20244.8 KiB136122

canvas_perf.jsD12-May-202424.4 KiB715637

package-lock.jsonD12-May-202434.6 KiB914913

package.jsonD12-May-2024393 1918

path-transform.htmlD12-May-20247 KiB19024

perf-canvaskit-with-puppeteer.jsD12-May-20249.1 KiB314264

perf_all_skps.shD12-May-20242 KiB5031

render-skp.htmlD12-May-20243.4 KiB9877

skottie-frames.htmlD12-May-20245.6 KiB172151

skp_data_prep.jsD12-May-20244.1 KiB11090

README.md

1Measuring the performance of CanvasKit using Puppeteer and Chrome.
2
3## Initial setup
4
5Run `npm ci` to install the dependencies need to run the tests. In //modules/canvaskit, run
6`make release` to build the canvaskit that will be used. With modifications to the Makefile,
7other builds (e.g. `make profile`) can be used as well.
8
9If needed, one can download the lottie-samples and/or skp assets from CIPD using the sk tool:
10```
11sk asset download lottie-samples ~/Downloads/lottie-samples
12sk asset download skps ~/Downloads/skps
13```
14
15The actual location that these assets can be downloaded to is not important - the Makefile assumes
16them to be in Downloads, but that can be modified by the local user.
17
18## Basic Performance Tests
19We have a harness for running benchmarks. Benchmark code snippets can be added to `canvas_perf.js`.
20The harness itself is the `canvas_perf.html` and `benchmark.js`. It will run the "test" portion of
21the code on multiple frames and gather data.
22
23To run the benchmarks, run `make perf_js`. By default, this will use the most recent release build
24of canvaskit done locally. If you want to only run one or a few, modify the
25`canvas_perf.js` file by changing the relevent `tests.push` to `onlytests.push` and then run
26`make perf_js`.
27
28On the CI, the results from these tests are uploaded to Perf. For example:
29<https://perf.skia.org/e/?queries=test%3Dcanvas_drawOval>
30We include metrics such as the 90th, 95th, and 99th percentile frame, average frame time, median
31frame time, and standard deviation. There are three types of measurements: without_flush_ms is
32the measurement of the test() function; with_flush_ms is the measurement of test() and the
33subsequent flush() call; total_frame_ms is the frame-to-frame time. Frame-to-frame is important to
34measure because it accounts for any work the GPU needs to do, even after CanvasKit flushes.
35
36## Skottie Frames Performance
37There is a harness that gathers data about rendering 600 frames of a skottie animation, cycling
38through it in a similar fashion to how it would be displayed to a user (e.g. as it is on
39skottie.skia.org).
40
41To test it locally with a specific skottie animation, feel free to modify the Makefile to adjust the
42`input_lottie` argument and then run `make frames`. The harness itself is `skottie-frames.html` and
43`benchmark.js`.
44
45On the CI, the results from these tests are uploaded to Perf. For example:
46<https://perf.skia.org/e/?queries=test%3Dlego_loader>
47We include metrics such as the first 5 frame times, average frame times, 90th, 95th and 99th
48percentile frame time.
49
50## SKP Performance
51There is a harness that repeatedly will draw an SKP and measure various metrics. This is handled
52by `skottie-frames.html` and `benchmark.js`. As before, feel free to modify the Makefile (the
53`input_skp` argument) and run `make skp`.
54
55On the CI, the results from these tests are uploaded to Perf. For example:
56<https://perf.skia.org/e/?queries=binary%3DCanvasKit%26test%3Ddesk_chalkboard.skp>