Skip to content

test(file-search): add performance harness - #513

Closed
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-file-search-harness
Closed

test(file-search): add performance harness#513
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-file-search-harness

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

What changed

  • Added scripts/file-search-perf-harness.mjs, a deterministic temp-home benchmark for initial indexing, normal queries, path-like queries, watcher-style update batches, and delete/tombstone batches.
  • Added scripts/test-file-search-perf-harness.mjs with generous regression thresholds and temp-home cleanup assertions.
  • Added npm run perf:file-search as the discoverable local entrypoint.
  • Added a narrow __fileSearchIndexPerfHarness export so the harness can reset/rebuild/apply watcher batches against a supplied temp home without relying on production timers or the real home directory.

Why

Optimization threads are expected to change file-search rebuilds, path queries, and delete/update handling. This gives those changes a repeatable local measurement target and a fast smoke test so regressions are visible before they reach review.

Compatibility impact

  • No intended production search behavior change.
  • The only runtime-source change is an additional exported perf-harness hook; normal indexing, watching, querying, and IPC paths are unchanged.
  • The harness creates a synthetic OS-temp home, resolves symlinked temp paths, cleans up by default, and never indexes the real user home.

How tested

  • node scripts/file-search-perf-harness.mjs --projects 12 --modules 4 --files-per-module 6 --query-runs 3 --updates 16 --deletes 16 --limit 10 --threshold-index-ms 15000 --threshold-normal-query-p95-ms 2000 --threshold-path-query-p95-ms 2000 --threshold-watch-update-ms 5000 --threshold-delete-ms 5000
File search perf harness
Indexed entries: 472
Initial indexing: 62.125ms
Normal queries: mean 0.740ms, p95 6.477ms, results 120
Path-like queries: mean 0.543ms, p95 1.145ms, results 90
Watcher-style updates: 0.454ms for 16 paths
Delete batch: 1.081ms for 16 paths
Post-update query: 0.215ms (10 results)
Deleted exact matches after tombstone: 0
Thresholds: passed
  • node --test scripts/test-file-search-perf-harness.mjs
  • node --test 'scripts/test-*.mjs'
  • node --check scripts/file-search-perf-harness.mjs
  • node --check scripts/test-file-search-perf-harness.mjs
  • git diff --check
  • ./node_modules/.bin/tsc -p tsconfig.main.json
  • node scripts/check-i18n.mjs exits 0; it still reports existing Italian locale gaps for settings.ai.whisper.vocabulary and settings.extensions.appSearchScope.
  • Codex LSP diagnostics reported no errors for src/main/file-search-index.ts, scripts/file-search-perf-harness.mjs, and scripts/test-file-search-perf-harness.mjs after dependencies were available.

@JustYannicc JustYannicc changed the title [codex] Add file search perf harness test(files): add file search perf harness Jul 3, 2026
@JustYannicc JustYannicc changed the title test(files): add file search perf harness test(file-search): add performance harness Jul 3, 2026
@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by the consolidated upstream PR #535: #535

@JustYannicc JustYannicc closed this Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant