Skip to content

perf(core): parallelize binary checks with content indexing off - #993

Closed
dkovalenko-oai wants to merge 2 commits into
mainfrom
codex/parallel-binary-classification
Closed

dkovalenko-oai wants to merge 2 commits into
mainfrom
codex/parallel-binary-classification

Conversation

@dkovalenko-oai

@dkovalenko-oai dkovalenko-oai commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

When content indexing is off, check files for binary content on up to two background workers before publishing the file index. Each worker uses the scanned file size as its read limit and skips files already marked binary. The scan uses the new index for classification, so a full rescan catches same-size rewrites even when the modification time matches.


Apple silicon macOS, warm filesystem cache, 24,576 files in a linked Git worktree, and the ripgrep walker. Medians from eight interleaved process runs per build. Startup and rescan timings include binary classification and Git status.

Metric Main (b3b8ced) #987 (0dcff51) This PR
Startup wall 1,230 ms 1,381 ms 988 ms
Idle full rescan wall 1,272 ms 185 ms 1,112 ms
Startup CPU 1,530 ms 1,632 ms 1,876 ms
Idle full rescan CPU 1,515 ms 362 ms 1,907 ms
First grep page wall 7.7 ms 7.6 ms 8.8 ms
Full-tree grep with no hits, wall 246 ms 311 ms 402 ms

Startup medians were lower, with enough host variation that the paired intervals still include zero. The no-hit query took longer on this host, with similar process CPU time. #987 skips unchanged text on rescan. This PR checks every eligible file on rescan to give regular file results a fresh verdict.

Filesystem watcher

Same fixture with real macOS FSEvents and watching on. Medians from six interleaved runs per build. The file edit changes a text file's binary flag. The ignore file change excludes one tracked file, and the full rescan measurement includes binary classification and Git status.

Metric Main #987 This PR
Incremental edit wall 74 ms 77 ms 80 ms
Watcher-triggered full rescan wall 914 ms 203 ms 719 ms
Watcher-triggered full rescan CPU 1,014 ms 261 ms 1,287 ms

Every file edit stayed incremental. Edit latency was similar across builds. For the full rescan, this PR reduced elapsed time versus main while using more CPU. #987 was faster on this mostly unchanged tree.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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