-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
area: coreLogic for Indexer, Parser, Graph, or Generator.Logic for Indexer, Parser, Graph, or Generator.area: dbDatabase schema, VectorStore, and Query logic.Database schema, VectorStore, and Query logic.enhancementNew feature or request (e.g., config file, depth control).New feature or request (e.g., config file, depth control).priority: mediumNormal priority; adds value but not urgent.Normal priority; adds value but not urgent.
Description
Problem
The --depth context expansion logic in ContextGenerator::generate currently loads all relationship edges from the database into a Vec and performs a full-scan loop for every depth iteration. For large projects with thousands of nodes and edges, this
Proposed Solution
- Optimize the graph traversal logic in
src/core/generator.rs. -
Option A: Transform the edge list into an Adjacency List (
HashMap<String, Vec<String>>) in memory so that neighbor lookups take$O(1)$ time. -
Option B: Utilize SQLite's
Recursive CTEinsrc/db/query.rsto delegate the deep traversal entirely to the database engine.
Definition of Done
- Graph traversal logic is updated (Adjacency List or Recursive CTE).
- Generation time with
--depth 2or higher is significantly reduced on large repositories. - The output context remains exactly the same as the unoptimized version.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: coreLogic for Indexer, Parser, Graph, or Generator.Logic for Indexer, Parser, Graph, or Generator.area: dbDatabase schema, VectorStore, and Query logic.Database schema, VectorStore, and Query logic.enhancementNew feature or request (e.g., config file, depth control).New feature or request (e.g., config file, depth control).priority: mediumNormal priority; adds value but not urgent.Normal priority; adds value but not urgent.