The Performance Dashboard reads performance data from databases and serves interactive dashboards to highlight how a commit impacts performance, allowing for easy exploration and annotation.
The product is particularly useful for:
First check out this repo and get all the dependencies as described in the top-level README.md, including the Cloud SDK, which is needed to run tests locally.
All building and testing is done by Bazel (optionally wrapped with Bazelisk), but there is a Makefile that records regularly used commands.
To build the full project:
bazelisk build --config=mayberemote //perf/...
To run all the tests:
bazelisk test --config=mayberemote //perf/...
Note the first time you run this it will fail and inform you of the gcloud simulators that need to be running in the background and how to start them.
There are several ways to run Perf locally depending on your needs.
This is the most common way to run Perf for frontend development. It uses a local database with pre-populated demo data.
To run with a fresh database (demo data is re-ingested on every run):
make run-demo-instance
To run without tearing down the database between runs:
make run-demo-instance-db-persist
After the server starts, navigate to http://localhost:8002.
For backend changes, you may want to run your local instance against a copy of a production database.
./run_with_spanner.sh p=<project> i=<instance> d=<database> config=<config_path>
For example, to run against the internal Chrome perf instance:
./run_with_spanner.sh p=skia-infra-corp i=tfgen-spanid-20241205020733610 d=chrome_int config=./configs/spanner/chrome-internal.json
Parameters:
p
: The GCP project. skia-infra-corp
for internal instances, skia-infra-public
for public ones.i
: The Spanner instance ID.d
: The Spanner database name.config
: Path to the instance configuration file. See perf/configs/
for examples.If you are working on features that require login, you can run a local authentication proxy. This proxy will sit in front of the Perf server and handle authentication before forwarding requests to it. To start this setup:
make run-auth-proxy-before-demo-instance
Then run the server as described above.
After the server starts, navigate to http://localhost:8003.
You can view demo/test pages of a web components by running demopage.sh
from the root of the repo and passing in the relative path of the web component you want to view, for example:
./demopage.sh perf/modules/day-range-sk
Additionally, the remote backend can be reverse-proxied such that the demo page server will forward APIs under /_/
to the remote backend (ENV_REMOTE_ENDPOINT
)
ENV_REMOTE_ENDPOINT='https://v8-perf.skia.org' ./demopage.sh perf/modules/day-range-sk
or
ENV_REMOTE_ENDPOINT='https://v8-perf.skia.org' bazelisk run //perf/modules/plot-summary-sk:demo_page_server
This will allow the demo page to fetch the real data.
Note you need to have entr
installed for this to work:
sudo apt install entr
If you see errors related to ptrace scope, you may need to run:
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
If you get INVALID_ARGUMENT: Invalid credentials path specified: /acct_credentials.json
, check your gcloud configuration and make sure you are logged in:
gcloud auth application-default login
If you see a PermissionDenied
error related to the issue tracker API key when running locally (e.g., failed to access secret version: rpc error: code = PermissionDenied desc = Permission 'secretmanager.versions.access' denied for resource 'projects/skia-infra-public/secrets/perf-issue-tracker-apikey/versions/latest'
), you can disable issue tracker integration in your local configuration file. For example, if you are using perf/configs/spanner/chrome-internal.json
:
"notifications": "anomalygroup"
to "notifications": "none"
.issue_tracker_config
section from the file.To create a new CL (Change List) in Gerrit, follow these steps. For more detailed information and best practices, please refer to the Skia Gerrit documentation.
Create a new branch from origin/main
:
git checkout -b <your-branch-name> -t origin/main
Make your changes and commit them.
Upload for review:
git cl upload
When running the application locally, a debug server is also started on port 9000. This server exposes Go's standard pprof
profiling data, which is useful for debugging performance issues and memory leaks.
To get meaningful profiles, you may want to generate some load on the server first, for example by loading several different graphs in the UI.
You can connect to the profiling endpoints using go tool pprof
. For example, to inspect the heap profile:
go tool pprof "http://localhost:9000/debug/pprof/heap"
Once in the pprof
interactive console, you can use commands like top
to see the top memory consumers or web
to visualize the call graph.
For internal use, you can also use pprof
to visualize the profile as a flame graph and compare it with another profile:
pprof -flame -symbolize=none (profile)
To get a full stack dump of all running goroutines, which can help identify leaks, visit the following URL in your browser or use curl
:
http://localhost:9000/debug/pprof/goroutine?debug=2
The following are some example production instances. For the complete list, refer to the configurations in the perf/configs/
directory.
See also Chromium Infra Glossary.
The current Perf infrastructure in this repo was originally developed for Skia. In 2023, a project began to unify it with Chrome's performance tooling, replacing a legacy Python-based system. This unification effort involves consolidating features from both platforms onto this modern Go and TypeScript stack, with the goal of eventually deprecating the older system.
File | Description |
---|---|
ai_generated_doc.md | Overview of the system by Gemini |
API.md | How to use the HTTP/JSON API for alerts. |
BACKUPS.md | Instructions for backing up regression and alert data. |
CHECKLIST.md | A checklist for launching a new Perf instance. |
DESIGN.md | The design documentation for Perf. |
FORMAT.md | Details on the Skia Perf JSON data format. |
PERFSERVER.md | Documentation for the perfserver command-line tool. |
PERFTOOL.md | Documentation for the perf-tool command-line tool. |
PROD.md | A manual for operating Perf in a production environment. |
Spanner.md | Information on the Spanner integration and running the emulator. |
TRIAGE.md | Design for the regression triage page. |