You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CSV conversion scales quadratically with leading blank lines #2449
CSV conversion slows down quadratically when a file contains a long run of blank lines before the header or immediately after it. The output is correct, but trimming those rows takes most of the conversion time.
On Windows with Python 3.13.15 and MarkItDown 0.1.8b1 (source commit b59e064), the medians were 0.0296 s, 0.1170 s, and 0.6953 s. These are synthetic inputs, not timings from a production workload.
Since these inputs differ only in the number of blank lines, I'd expect conversion time to grow roughly linearly. _trim_outer_blank_rows currently calls pop(0) or pop(1) for every blank row, shifting the remaining list each time. Removing each blank run in one slice avoids that repeated work while preserving the output.
Activity
afourney commentedon Sep 10, 2026
Good point. We can do better