docs(fs): make glob benchmark commands work on clean checkouts

This commit is contained in:
_Kerman authored and imccyu committed 2026-10-26 12:04:34 +08:00
1 parent e8bdbbe823
commit dfaf756199
2 files changed
+6 -4

No files matched your search

+3 -2
View File
@@ -114,11 +114,12 @@ Each call resolves the packaged binary (`@vscode/ripgrep`, or the executable's `
After `pnpm run build`, compile the package-local diagnostic with external runtime dependencies, then run it under plain Node:
```sh
cd packages/fs/tool-fs-search
node --input-type=module <<'JS'
import { build } from 'tsdown';
await build({ config: false, tsconfig: false, dts: false, entry: 'packages/fs/tool-fs-search/tests/glob-native.perf.ts', outDir: 'packages/fs/tool-fs-search/tests/.dsh-build', clean: false, deps: { neverBundle: [/^[^./]/] } });
await build({ config: false, tsconfig: false, dts: false, entry: 'tests/glob-native.perf.ts', outDir: 'tests/.dsh-build', clean: false, deps: { neverBundle: [/^[^./]/] } });
JS
node packages/fs/tool-fs-search/tests/.dsh-build/glob-native.perf.mjs
node tests/.dsh-build/glob-native.perf.mjs
```
The diagnostic creates 20,000 unrelated files and six matches, then measures five `ctx.tools.execute()` calls through the Native executor with a real Agent, working-directory service, and local subprocess backend. It reports raw timings, the median, and a hash of the complete value, text, and presentation metadata. `--plugin <built-module>` selects another search-package revision; `--workspace <directory>` opts into a read-only existing workspace instead of the synthetic tree. Setup, model generation, UI, and Session persistence are excluded; there is no timing threshold.
+3 -2
View File
@@ -114,11 +114,12 @@ Node 部署在受支持的 macOS、Linux 与 Windows 目标上获得 `@vscode/ri
运行 `pnpm run build` 后,将包内诊断脚本编译为外部引用运行时依赖的产物,再用普通 Node 运行:
```sh
cd packages/fs/tool-fs-search
node --input-type=module <<'JS'
import { build } from 'tsdown';
await build({ config: false, tsconfig: false, dts: false, entry: 'packages/fs/tool-fs-search/tests/glob-native.perf.ts', outDir: 'packages/fs/tool-fs-search/tests/.dsh-build', clean: false, deps: { neverBundle: [/^[^./]/] } });
await build({ config: false, tsconfig: false, dts: false, entry: 'tests/glob-native.perf.ts', outDir: 'tests/.dsh-build', clean: false, deps: { neverBundle: [/^[^./]/] } });
JS
node packages/fs/tool-fs-search/tests/.dsh-build/glob-native.perf.mjs
node tests/.dsh-build/glob-native.perf.mjs
```
诊断脚本创建 20,000 个无关文件和六个匹配文件,然后通过 Native executor 测量五次 `ctx.tools.execute()` 调用,使用真实 Agent、工作目录服务和本地 subprocess 后端。输出包括原始耗时、中位数,以及完整值、文本和展示元数据的哈希。`--plugin <built-module>` 选择其他搜索包版本;`--workspace <directory>` 显式选择只读的现有工作区,替代合成目录。计时排除初始化、模型生成、UI 和 Session 持久化;不设耗时阈值。