Investigate performance regressions and find opportunities for optimization
foo).pnpm bench:compare main foo
If you pass one branch, bench:compare automatically compares it to main.
benchmarking/compare/.results/report.txtbenchmarking/compare/.results/main.jsonbenchmarking/compare/.results/<your-branch>.jsonbenchmarking/compare/.profiles/main/*.cpuprofilebenchmarking/compare/.profiles/main/*.mdbenchmarking/compare/.profiles/<your-branch>/*.cpuprofilebenchmarking/compare/.profiles/<your-branch>/*.mdThe .md files are generated summaries of the CPU profile and are usually the fastest way to inspect hotspots.
benchmarking/compare/.results/report.txt and identify largest regressions first.benchmarking/compare/.profiles/main/<benchmark>.mdbenchmarking/compare/.profiles/<branch>/<benchmark>.mdruntime.js, reactivity/batch.js, reactivity/deriveds.js, reactivity/sources.js).Run only selected reactivity benchmarks by substring:
pnpm bench kairo_mux kairo_deep kairo_broad kairo_triangle
pnpm bench repeated_deps sbench_create_signals mol_owned
Runtime reactivity regressions are most likely in runes runtime tests:
pnpm test runtime-runes
For quick cpuprofile hotspot deltas between two branches:
node benchmarking/compare/profile-diff.mjs kairo_mux_owned main foo
This prints top function sample-share deltas for the selected benchmark.
bench:compare checks out branches while running. Avoid uncommitted changes (or stash them) so branch switching is safe.bench:compare run rewrites benchmarking/compare/.results and benchmarking/compare/.profiles.