See the design document for details and upcoming changes.
The performance tests cover three stores. The Tests ingest update data relevant to each store and measure the time taken for the ingestion process.
| Store | Description | Content |
|---|---|---|
SvDsoStore |
DSO's internal governance data | ACS contracts |
ScanStore |
DSO's public queryable data | ACS contracts and Tx Log |
UpdateHistory |
DSO's append-only audit log | Updates and associated events (creates/exercises) |
Tests are automated while you can also trigger them manually.
Tests run daily on GHA workflow
- Go to GHA Performance Tests
- Click on "Run workflow" and select the branch you want to test.
- Click on "Run workflow" to start the tests.
You can also run the tests locally, where you need to configure a Postgres instance and download the test data beforehand.
# Start Postgres in a Docker container
./scripts/postgres.sh docker start
# Create the `splice_apps` database
./scripts/postgres.sh docker createdb splice_apps
# Download the test data (if not already done)
gcloud storage cp gs://mainnet-history-dumps/mainnetupdates.json /tmp/mainnetupdates.json
# Run the performance test from the root of the repo
sbt 'apps-app / Test / runMain org.lfdecentralizedtrust.splice.performance.SplicePerf run -t DbSvDsoStore -c ./apps/app/src/test/resources/performance/tests.conf -d /tmp/mainnetupdates.json'We download test data from the main-net and upload it to the GCP bucket. This operation is currently manual, but we
automate it in the future.
Test data dumps live in the GCP bucket
gs://mainnet-history-dumps.
# List all files
gcloud storage ls --long --recursive 'gs://mainnet-history-dumps/**'
# Download a file to local /tmp
gcloud storage cp gs://mainnet-history-dumps/mainnetupdates.json /tmp/mainnetupdates.json
# Upload a new test data file
gcloud storage cp ./new_dump.json gs://mainnet-history-dumps/new_dump.jsonPer-test thresholds are defined in .github/store-perf-thresholds.json.
The GHA workflow creates GH issues when a test exceeds its threshold.
The engineers on the CI monitoring rotation are responsible for triaging these issues and assigning them to the relevant
teams.
Historical performance data is available in
Grafana: https://grafana.splice.network.canton.global/d/splice-perf-ingestion/store-ingestion-performance
When a regression is reported (or you're proactively trying to make a component faster), follow this loop.
- Pick a recent run of the affected workflow
- Look at the per-test panels in Grafana
- Note which metric actually moved and by how much
From the metrics, form a statement about why the code-path is slow, e.g:
- Per-item time is up because we now do an extra
SELECTper row - CPU/wall ratio is ~0.2, so we're I/O-bound on Postgres, not on the app-side
- Peak heap doubled, so a new code path added more processing in memory.
Before changing any code, confirm the hypothesis is consistent with what the test metrics show. Run at least the tests two times and also cross-check at least two signals (e.g. ingestion total time and CPU/wall ratio).
Translate the hypothesis into the smallest possible change that would prove or disprove it. Better change one variable per experiment so you can attribute any delta to a single cause. E.g. changes:
- Batch the query
- Add an index, or remove a redundant one
- Increase / decrease DB
max-connectionsor batch size - Enable / disable extra processing added in app code
- On
main(or the branch before your change), run the relevant perf test locally — see Running locally — and record the metrics - Apply the change on a branch.
- Re-run the same test, with the same data file and the same Postgres container, Compare the new metrics JSON against the baseline.
A local run give you enough signals if the metric you're chasing moves clearly, but always verify the changes on CI, which is the baseline infrastructure we use.
- Push the branch
- Trigger test manually - see Running manually
- Wait for the run to finish, then compare its metrics data (from Grafana or JSON) against recent
mainruns - Merge the change once the CI-run metrics confirm the improvement and show no regression elsewhere
- If the new numbers are meaningfully better, update the relevant threshold in
Thresholdsso future regressions are caught against the new thresholds. - Mention the hypothesis, the experiment, and the before/after numbers in the PR description so the next person tuning this code has some context.