Skip to content

perf: Reuse CodeChunker in RAGIndexer._index_file #152

@omsherikar

Description

@omsherikar

Scope

refactron/rag/indexer.py_index_file

Problem

Every indexed file does CodeChunker(self.parser) inside the loop. The chunker is stateless aside from the parser reference; reallocating it per file adds avoidable overhead in large repos.

Suggested direction

  • Instantiate CodeChunker once in RAGIndexer.__init__ Reuse it in _index_file.

Acceptance

  • No behavior change; tests green.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions