Skip to content

ptx: avoid per-word filename clones and line rescans for performance/…#13475

Closed
Aisha630 wants to merge 1 commit into
uutils:mainfrom
Aisha630:optimize-ptx
Closed

ptx: avoid per-word filename clones and line rescans for performance/…#13475
Aisha630 wants to merge 1 commit into
uutils:mainfrom
Aisha630:optimize-ptx

Conversation

@Aisha630

Copy link
Copy Markdown

…memory improvement

Store a file_idx into FileMap on each WordRef instead of cloning the filename per word, and index the map directly instead of scanning it by name and line range on every output line. Also cache the keyword's character offset (char_position) computed during create_word_set, so prepare_line_chunks no longer rescans the line prefix on each call.

ptx: avoid per-word filename clones and line rescans for performance/memory improvement

…memory improvement

Store a `file_idx` into `FileMap` on each `WordRef` instead of cloning
the filename per word, and index the map directly instead of scanning it
by name and line range on every output line. Also cache the keyword's
character offset (`char_position`) computed during `create_word_set`,
so `prepare_line_chunks` no longer rescans the line prefix on each
call.

ptx: avoid per-word filename clones and line rescans for performance/memory improvement
@Aisha630 Aisha630 closed this Jul 20, 2026
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.

1 participant