mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 05:50:35 +00:00
The coming refactors and fixes change sync code, and a slowdown must be seen and explained in the commit that causes it. A JVM benchmark now times component sync on fixed-size worlds: - one main into 10, 100 and 1000 copies; - a change in the deepest of three nesting levels; - a chain of dependents (a in b in c, with copies of each); - a variant switch in a main with 100 copies; - a library update into a file with 500 copies. Each world is built once; only the sync an edit causes is timed, run to a fixpoint as the frontend watcher does. Each checks its result, so a world that synced nothing fails instead of timing nothing. `scripts/bench-components record` writes the baseline, recorded here on the code before this commit; `scripts/bench-components` compares against it and exits 1 when a world is more than 10% slower. It compares the lower quantile: with the devenv running, the mean of the same code moved from 0.41 to 1.13 of the baseline, the lower quantile by under 12%.
9 lines
394 B
Bash
Executable File
9 lines
394 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Runs the component sync benchmark (`dev/bench/component_sync.clj`).
|
|
# scripts/bench-components compare against the recorded baseline
|
|
# scripts/bench-components record record a new baseline
|
|
# Exits 1 when a world is more than 10% slower than its baseline.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
exec clojure -M:dev -m bench.component-sync "${1:-compare}"
|