Skip to content

fix: graph cache + indexed lookups — eliminate process-per-call and quadratic scans (#125)#436

Open
justrach wants to merge 1 commit intomainfrom
fix/125-perf-heavy-process-per-call-and-quadratic-scans-in
Open

fix: graph cache + indexed lookups — eliminate process-per-call and quadratic scans (#125)#436
justrach wants to merge 1 commit intomainfrom
fix/125-perf-heavy-process-per-call-and-quadratic-scans-in

Conversation

@justrach
Copy link
Copy Markdown
Owner

Summary

  • Add file_path_index (StringHashMap) and symbols_by_file (AutoHashMap) to CodeGraph for O(1) lookups instead of linear scans
  • Replace linear findFileId scan with HashMap lookup via findFileByPath()
  • Replace full-symbol scan in symbolAt with per-file symbolsInFile() index
  • Cache decoded graph in tools.zig across calls with mtime-based invalidation
  • rebuildIndexes() called after deserialization for loaded graphs
  • Closes perf: heavy process-per-call and quadratic scans in graph query hot paths #125

…uadratic scans (#125)

- Add file_path_index and symbols_by_file HashMaps to CodeGraph for O(1) lookups
- Replace linear findFileId scan with file_path_index HashMap lookup
- Replace full-symbol scan in symbolAt with per-file symbolsInFile index
- Cache decoded graph in tools.zig across calls with mtime invalidation
- RebuildIndexes after deserialization for loaded graphs
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.

perf: heavy process-per-call and quadratic scans in graph query hot paths

1 participant