opencode
opencode copied to clipboard
perf: optimize file tree scanning for large repositories
Summary
Use git ls-files instead of ripgrep for file tree generation (~7000x faster on large repos).
Problem
On large repos (42k+ files), file tree generation was taking 8+ seconds because ripgrep scanned ALL files before limiting output to 200.
Changes
- Add
FileTreemodule usinggit ls-files --cached --others --exclude-standard - Cache file tree at Instance level
- Remove
Ripgrep.tree(replaced byFileTree.tree)
Performance (M3 MacBook Pro, 42k file repo)
- File tree: 8.39s → ~1ms
🤖 Generated with Claude Code