Current findall() loads all matches into memory. For large files (GB+), this causes OOM errors.
Feature Request
Implement lazy evaluation for findall() that yields results without loading entire file
Add Parser.findall_lazy(file_handle, chunk_size=8192) method
Support backtracking across chunk boundaries for multi-line patterns
Handle partial matches at chunk edges
Maintain accurate span positions across chunks
Test Complexity
Mock file objects with gigabyte-size data
Edge cases: pattern split across chunks
Memory profiling tests
Performance benchmarks vs current implementation
Why Complex
Requires buffer management for patterns spanning chunk boundaries
Need to maintain accurate byte offsets
Must handle regex backtracking across chunks
Complex state machine for partial match handling
Current
findall()loads all matches into memory. For large files (GB+), this causes OOM errors.Feature Request
Implement lazy evaluation for
findall()that yields results without loading entire fileAdd
Parser.findall_lazy(file_handle, chunk_size=8192)methodSupport backtracking across chunk boundaries for multi-line patterns
Handle partial matches at chunk edges
Maintain accurate span positions across chunks
Test Complexity
Mock file objects with gigabyte-size data
Edge cases: pattern split across chunks
Memory profiling tests
Performance benchmarks vs current implementation
Why Complex
Requires buffer management for patterns spanning chunk boundaries
Need to maintain accurate byte offsets
Must handle regex backtracking across chunks
Complex state machine for partial match handling