performance investigation
- Repo stars 86,684
- Author repo svelte
- Domain
- AI
- Author-declared agents
- No explicit declaration found; this is not inferred or tested compatibility
- Static check
- 88 / 100 · heuristic scan, not runtime safety proof
- Runtime evidence
- Not run; no isolated runtime test evidence is currently recorded
- Author / version / license
- @sveltejs · no license declared
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- macOS · Linux · Windows
- Runtime requirements
- Node.js
- Detected file/system behavior
-
- Read-only
- Network behavior
- Local-only
- Install commands
- None (reference only)
Heads up: Tool permissions are not declared; actual access depends on the runtime.
# Where outputs go
- Summary report: `benchmarking/compare/.results/report.txt`
- Raw benchmark numbers:
- `benchmarking/compare/.results/main.json`
- `benchmarking/compare/.results/<your-branch>.json`
- CPU profiles (per benchmark, per branch):
- `benchmarking/compare/.profiles/main/*.cpuprofile`
## Quick start
1. Start from a branch you want to measure (for example `foo`).
2. Run:
```sh
pnpm bench:compare main foo
```
If you pass one branch, `bench:compare` automatically compares it to `main`.
## Where outputs go
- Summary report: `benchmarking/compare/.results/report.txt`
- Raw benchmark numbers:
- `benchmarking/compare/.results/main.json`
- `benchmarking/compare/.results/<your-branch>.json`
- CPU profiles (per benchmark, per branch):
- `benchmarking/compare/.profiles/main/*.cpuprofile`
- `benchmarking/compare/.profiles/main/*.md`
- `benchmarking/compare/.profiles/<your-branch>/*.cpuprofile`
- `benchmarking/compare/.profiles/<your-branch>/*.md`
The `.md` files are generated summaries of the CPU profile and are usually the fastest way to inspect hotspots.
## Suggested investigation flow
1. Open `benchmarking/compare/.results/report.txt` and identify largest regressions first.
2. For each high-delta benchmark, compare:
- `benchmarking/compare/.profiles/main/<benchmark>.md`
- `benchmarking/compare/.profiles/<branch>/<benchmark>.md`
3. Look for changes in self/inclusive hotspot share in runtime internals (`runtime.js`, `reactivity/batch.js`, `reactivity/deriveds.js`, `reactivity/sources.js`).
4. Make one optimization change at a time, then re-run targeted benches before re-running full compare.
## Fast benchmark loops
Run only selected reactivity benchmarks by substring:
```sh
pnpm bench kairo_mux kairo_deep kairo_broad kairo_triangle
pnpm bench repeated_deps sbench_create_signals mol_owned
```
## Tests to run after perf changes
Runtime reactivity regressions are most likely in runes runtime tests:
```sh
pnpm test runtime-runes
```
## Helpful script
For quick cpuprofile hotspot deltas between two branches:
```sh
node benchmarking/compare/profile-diff.mjs kairo_mux_owned main foo
```
This prints top function sample-share deltas for the selected benchmark.
## Practical gotchas
- `bench:compare` checks out branches while running. Avoid uncommitted changes (or stash them) so branch switching is safe.
- Each `bench:compare` run rewrites `benchmarking/compare/.results` and `benchmarking/compare/.profiles`.
Sections and files
Listed in source order.
sections -> Quick start → Where outputs go → Suggested investigation flow → Fast benchmark loops → Tests to run after perf changes → Helpful script
terms -> 1. Start from a branch you want to measure (for example foo). · If you pass one branch, bench:compare automatically compares it to main. · The .md files are generated summaries of the CPU profile and are usually the fastest way to inspect hotspots. · 1. Open benchmarking/compare/.results/report.txt and identify largest regressions first. · This prints top function sample-share deltas for the selected benchmark. · - bench:compare checks out branches while running.
files/cmd -> foo · bench:compare · main · benchmarking/compare/.results/report.txt · benchmarking/compare/.results/main.json · benchmarking/compare/.results/<your-branch>.json · benchmarking/compare/.profiles/main/*.cpuprofile · benchmarking/compare/.profiles/main/*.md
body sha256 -> 898549e48cd3
Quick start
Start from a branch you want to measure (for example
foo). Run: If you pass one branch,bench:compareautomatically compares it tomain.Where outputs go
Summary report:
benchmarking/compare/.results/report.txtRaw benchmark numbers:benchmarking/compare/.results/main.jsonbenchmarking/compare/.results/<your-branch>.jsonCPU profiles (per benchmark, per branch):Suggested investigation flow
Open
benchmarking/compare/.results/report.txtand identify largest regressions first. For each high-delta benchmark, compare:benchmarking/compare/.profiles/main/<benchmark>.mdbenchmarking/compare/.profiles/<branch>/<benchmark>.mdLook for changes in self/inclusive hotspot share in runtime internals (runtime.js,reactivity/batch.js,reactivity/deriveds.js,reactivity/sources.js).Fast benchmark loops
Run only selected reactivity benchmarks by substring:
Tests to run after perf changes
Runtime reactivity regressions are most likely in runes runtime tests: