miller/pkg
John Kerl 5b29ad1596 EXPERIMENT (negative result): zero-copy CSV reader
Prototype of a zero-copy CSV record reader (ZeroCopyCSVReader): reads input
in large persistent blocks and returns field strings as unsafe.String views
directly into the block, eliminating the stdlib-derived parser's per-record
string() copy and recordBuffer accumulation. Unquoted records are fully
zero-copy; quoted records delegate to the go-csv parser for correctness.

Correctness: full regression suite passes, including a deterministic stress
run with a 3-byte forced block size (maximal boundary splitting). Required
fixing comment trailing-newline handling, comment-before-quote ordering, and
absolute error-line-number rewriting for delegated quoted records.

Performance: NEGATIVE RESULT -- do not merge.
  - Wall-clock neutral: CSV cat is I/O-bound (syscall ~56%) after the
    allocation-batching work, so removing the per-record copy saves CPU that
    already overlapped with I/O on idle cores (confirmed under GOGC variations
    and across cat/stats1/cut).
  - Peak RSS 2-2.6x WORSE (162MB -> 357-423MB) at every block size: zero-copy
    pins whole input blocks while any field references them, and the pipeline
    buffers up to 500 batches, so many blocks stay live at once. The stdlib
    parser's per-record strings keep memory proportional to live data.

Committed for the record; tracked in a GitHub issue. Not for merge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 15:25:35 -04:00
..
auxents Performance and style fixes (#1981) 2026-02-18 09:19:31 -05:00
bifs Fix mlr -s shebang doc and reject arrays/maps in contains/index (#1658) (#2058) 2026-05-17 11:40:39 -04:00
cli Add --omd-aligned flag for column-padded markdown output (#2057) 2026-05-16 11:41:01 -04:00
climain Default to "cat" verb when none is supplied (#2060) 2026-05-17 12:13:21 -04:00
colorizer Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
dkvpx Add DKVPX file format (#2002) 2026-03-02 22:35:08 -05:00
dsl Fix mlr -s shebang doc and reject arrays/maps in contains/index (#1658) (#2058) 2026-05-17 11:40:39 -04:00
entrypoint Improve error propagation (#1975) 2026-02-16 16:48:41 -05:00
go-csv Some fixes for staticcheck (#2006) 2026-03-03 09:27:03 -05:00
input EXPERIMENT (negative result): zero-copy CSV reader 2026-06-19 15:25:35 -04:00
lib Fix column alignment for wide and combining Unicode chars (#1520, #379) (#2061) 2026-05-17 12:12:54 -04:00
mlrval Batch-allocate per-record objects; reuse CSV writer field buffer 2026-06-19 12:27:22 -04:00
output Batch-allocate per-record objects; reuse CSV writer field buffer 2026-06-19 12:27:22 -04:00
parsing Replace GOCC parser-generator with PGPG (#2015) 2026-03-15 22:28:57 -04:00
pbnjay-strptime Performance and style fixes (#1981) 2026-02-18 09:19:31 -05:00
platform Performance and style fixes (#1981) 2026-02-18 09:19:31 -05:00
runtime Experiment with mlr script (#2009) 2026-03-05 20:14:32 -05:00
scan Performance and style fixes (#1981) 2026-02-18 09:19:31 -05:00
stream Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
terminals Default to "cat" verb when none is supplied (#2060) 2026-05-17 12:13:21 -04:00
transformers Apply join prefixes/rename to unpaired records (#1821) (#2062) 2026-05-17 12:35:58 -04:00
types Update performance docs (#1991) 2026-02-22 17:04:35 -05:00
version Post-6.18.1 release: back to 6.18.1-dev 2026-04-19 12:03:05 -04:00
README.md Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00

Please see ../../README-dev.md for an overview; please see each subdirectory for details about it.