性能 Investigation
- 作者仓库星标 86,684
- 作者仓库 svelte
Quick start
- Start from a branch you want to measure (for example
foo). - Run:
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.jsonbenchmarking/compare/.results/<your-branch>.json
- CPU profiles (per benchmark, per branch):
benchmarking/compare/.profiles/main/*.cpuprofilebenchmarking/compare/.profiles/main/*.mdbenchmarking/compare/.profiles/<your-branch>/*.cpuprofilebenchmarking/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
- 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>.md
- Look for changes in self/inclusive hotspot share in runtime internals (
runtime.js,reactivity/batch.js,reactivity/deriveds.js,reactivity/sources.js). - 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:
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:
pnpm test runtime-runes
Helpful script
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.
Practical gotchas
bench:comparechecks out branches while running. Avoid uncommitted changes (or stash them) so branch switching is safe.- Each
bench:comparerun rewritesbenchmarking/compare/.resultsandbenchmarking/compare/.profiles.
- 流狐分类
- AI 智能
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @sveltejs · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 即装即用
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- macOS · Linux · Windows
- 底层运行要求
- Node.js
- 检测到的文件与系统行为
-
- 只读
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
# 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` Start from a branch you want to measure (for example foo). Run: If you pass one branch, bench:compare automatically compares it to main.
Open benchmarking/compare/.results/report.txt and identify largest regressions first. For each high-delta benchmark, compare: benchmarking/compare/.profiles/main/<benchmark>.md
## 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
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Quick start → Where outputs go → Suggested investigation flow → Fast benchmark loops → Tests to run after perf changes → Helpful script
要点 -> 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.
文件/命令 -> 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
内容 SHA-256 -> 898549e48cd3
方法与流程
适用与边界
原文中的明确线索
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