This rewrite of splitByLineCount improves performance by reading and writing in blocks rather than reading and writing line-by-line. This reduces copying and forms a natural buffering for both reads and writes.
Performance gains are substantial on short lines (30+%), and smaller but still positive on long lines.
The main downside is that unit testing is more involved.
This rewrite of
splitByLineCount
improves performance by reading and writing in blocks rather than reading and writing line-by-line. This reduces copying and forms a natural buffering for both reads and writes.Performance gains are substantial on short lines (30+%), and smaller but still positive on long lines.
The main downside is that unit testing is more involved.