udoprog/bgrep2 — Issue #2: Only buffer what is necessary from input.
Author: udoprog
Created: 2011-12-09 10:27:13+00:00
State: open

Only the part of the input which is necessary for matching should be buffered at a time, this would improve runtime characteristics in memory usage.

I.e. the entire input should not be buffered in memory.

This does however impose a difficulty in displaying the results, since each match is stored in a result_list which references the absolute location of the match starting at 0. An alternative approach could be to store the matching chunk in the result list, or other intermediary storage until it is displayed.