perf(#3386): skip getcwd per file in custom filter #3387
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.33) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.33 · 150 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.300
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3387"
general
weight: 0.35
hood
Filters:customcallsvim.uv.cwd()for every scanned file, even with no custom filters.This change caches cwd once per scan and introduces an early exit when the ignore list is empty, eliminating redundant system calls across large directories.
Now
cwdis resolved inFilters:prepareas it's already the place for things computed once per directory (bufinfo, bookmarks). The cachedcwdcannot drift or change between prepare and its subsequent use, as both ops execute during the same sync scan.cwd is resolved only when pattern filters actually exist in ignore_list, avoiding unnecessary calls when pattern filtering is inactive.
Measured improvements:
NOTE: I benchmarked on macOS running Neovim 0.13-dev against a large test repository containing ~15k nodes and ~3k Git status entries, still untested on Windows and Linux environments, as well as Neovim 0.10 and 0.11 releases.
AI usage: helped myself w/ Claude Code (Opus 5.5) while self-reviewing the code and measuring the improvements.
resolves #3386