绩效调查
- 作者仓库星标 86,684
- 作者仓库 svelte
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @sveltejs · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- Node.js
- 检测到的文件与系统行为
-
- 只读
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
pnpm bench:compare main foo
## 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`.
章节与文件索引
按说明文件中的顺序排列。
快速启动
输出去向
建议的调查流程
快速基准循环
性能更改后运行的测试
文件/命令 -> 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
内容校验值 -> 898549e48cd3
当前原文的自动摘译,尚未人工审校。
快速启动
从您要测量的分支开始(例如
foo)。运行:如果您通过一个分支,bench:compare会自动将其与main进行比较。输出去向
摘要报告:
benchmarking/compare/.results/report.txt原始基准数据:benchmarking/compare/.results/main.jsonbenchmarking/compare/.results/<your-branch>.jsonCPU 配置文件(每个基准、每个分支):建议的调查流程
打开
benchmarking/compare/.results/report.txt并首先确定最大回归。对于每个高增量基准,比较:benchmarking/compare/.profiles/main/<benchmark>.mdbenchmarking/compare/.profiles/<branch>/<benchmark>.md查找运行时内部的自包/包含热点份额的变化(runtime.js、reactivity/batch.js、reactivity/deriveds.js、reactivity/sources.js)。快速基准循环
仅按子字符串运行选定的反应性基准:
性能更改后运行的测试
运行时反应性回归最有可能出现在符文运行时测试中: