opencode icon indicating copy to clipboard operation
opencode copied to clipboard

perf: optimize file tree scanning for large repositories

Open Karavil opened this issue 2 weeks ago • 0 comments

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 FileTree module using git ls-files --cached --others --exclude-standard
  • Cache file tree at Instance level
  • Remove Ripgrep.tree (replaced by FileTree.tree)

Performance (M3 MacBook Pro, 42k file repo)

  • File tree: 8.39s → ~1ms

🤖 Generated with Claude Code

Karavil avatar Dec 31 '25 04:12 Karavil