Skip to content

Render row sources into the writer's block buffer - #1238

Open
quinnj-bot[bot] wants to merge 1 commit into
claude/rowwriter-typed-rowsfrom
claude/write-rows-block-buffer
Open

quinnj-bot[bot] wants to merge 1 commit into
claude/rowwriter-typed-rowsfrom
claude/write-rows-block-buffer

Conversation

@quinnj-bot

@quinnj-bot quinnj-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Why

CSV.write on a row source, such as a Vector of NamedTuples, appended every cell to a plain Vector{UInt8}. Each digit, delimiter, and newline went through resize! bookkeeping. Column sources already render into _WriteBuffer, which reserves storage once per block and tracks its own length.

What changed

  • Row sources render into _WriteBuffer and flush it with _writeblock, the same buffer and sink write that column sources use.

Scope

Blast Radius

Only the row-source path of CSV.write changes. The writer tests compare row-source output with the column path, including transforms and sources without a schema, and check that an iterator that throws mid-write still leaves every complete row in the sink.

Verification

  • Row table (Vector of NamedTuples, 1M rows, one core), measured against Render RowWriter rows through the source schema #1237: small integers 179.0 → 147.5 M cycles, 0.83x (range 0.813 to 0.833). The 12-column mixed table measures 1250 → 1072 M cycles, 0.87x (range 0.842 to 1.146; one round ran at a load spike). That is the median of 7 interleaved fresh-process rounds. Column sources and RowWriter measured 0.99 to 1.00x.
  • New test: a row table larger than one 8 MiB block writes the same bytes as the column path. This exercises the mid-stream flush, which no test reached before.
  • Byte identity: the 1,464-case writer fingerprint from Write Bool cells without hashing their text #1235 hashes the same on main and on this branch, including row sources over every table shape, element type, and dialect.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.10%. Comparing base (6846469) to head (cb6a0cd).

Additional details and impacted files
@@                       Coverage Diff                       @@
##           claude/rowwriter-typed-rows    #1238      +/-   ##
===============================================================
+ Coverage                        96.05%   96.10%   +0.05%     
===============================================================
  Files                                9        9              
  Lines                             5885     5885              
===============================================================
+ Hits                              5653     5656       +3     
+ Misses                             232      229       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

CSV.write on a row source (a Vector of NamedTuples, a Tables.rows iterator)
appended every cell to a plain Vector{UInt8}, so each digit, delimiter, and
newline went through Vector resize! bookkeeping. Column sources already
render into _WriteBuffer, which reserves storage once and tracks the
logical length itself.

Row sources now use the same block buffer and sink write. Output bytes are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quinnj-bot
quinnj-bot Bot force-pushed the claude/write-rows-block-buffer branch from 1e22c3e to cb6a0cd Compare November 19, 2026 20:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant