Skip to content

perf(files): speed up delete tombstone batches#566

Closed
JustYannicc wants to merge 71 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-file-search-delete-tombstones
Closed

perf(files): speed up delete tombstone batches#566
JustYannicc wants to merge 71 commits into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-file-search-delete-tombstones

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

What changed

  • Split delete tombstoning so direct indexed file deletes mark their entry ids without scanning the whole snapshot.
  • Kept indexed directory deletes and unknown deleted paths on the descendant tombstone path.
  • Added focused coverage for direct-file batch behavior, unknown-path descendants, and direct/delete benchmark reporting.

Why

Large watcher delete batches can be mostly exact indexed file paths. The previous multi-path tombstone flow scanned every indexed entry even when all deleted paths were already known files, making delete batches much slower than watcher adds.

Compatibility impact

File-search behavior is preserved. Exact indexed file deletes are tombstoned directly, indexed directory deletes still tombstone descendants, and unknown deleted paths still tombstone indexed descendants. No feature trimming, config changes, or user-facing API changes.

How tested

  • node --test scripts/test-file-search-delete-batch.mjs scripts/test-file-search-perf-harness.mjs -> 7 passing tests.
  • ./node_modules/.bin/tsc -p tsconfig.main.json --noEmit -> passed.
  • Codex LSP diagnostics for src/main/file-search-index.ts -> no diagnostics found.
  • git diff --check -> passed.

Performance evidence

  • Before, exact audit harness: node scripts/file-search-perf-harness.mjs --projects 600 --modules 10 --files-per-module 10 --query-runs 2 --updates 500 --deletes 500 --limit 80 -> 79,804 indexed entries, watcher-style updates 7.685ms for 500 paths, delete batch 122.856ms for 500 paths.
  • After, same command: 79,804 indexed entries, watcher-style updates 8.487ms for 500 paths, delete batch 5.587ms for 500 paths, deleted exact matches after tombstone 0.
  • Focused benchmark after: node scripts/benchmark-file-search-delete-batch.mjs -> direct-file-batch 5.353ms for 500 paths over 80,161 entries; directory-tree-batch 8.561ms for 4,041 paths over 68,162 entries.

Stack validation

Started from 264fb89dc5c867d6c3d77bc4b95e26e235e326ea on codex/perf-consolidated-integration-stack / fork/codex/perf-consolidated-integration-stack. This branch contains one commit on top: e4d7dd7 perf(files): speed up delete tombstone batches. PR targets SuperCmdLabs/SuperCmd:main from JustYannicc:codex/perf-file-search-delete-tombstones.

Replaces

None.

…ated-integration-stack

# Conflicts:
#	src/renderer/src/raycast-api/hooks/use-cached-promise.ts
…ated-integration-stack

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime-renderers.tsx
#	src/renderer/src/raycast-api/list-runtime.tsx
…ated-integration-stack

# Conflicts:
#	src/renderer/src/CameraExtension.tsx
…ated-integration-stack

# Conflicts:
#	src/renderer/src/raycast-api/list-runtime.tsx
… into codex/perf-consolidated-integration-stack
@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by consolidated upstream PR #573: #573. Closing this smaller PR to keep the command/file wave consolidated.

@JustYannicc JustYannicc closed this Jul 4, 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