Repository navigation
perf: reduce CSV field copy amplification on 4.2-dev - #32769
Conversation
Preserve 4.2 raw admission and growth-denial semantics while reusing caller-owned buffers. Related to #32751.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
This pull request is merged. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 9f69d70ed44ec82ec0e80c0d2022d8237d81bf87
Assessment: approve
Direct fragment appends reuse the existing accumulator and preserve 4.2 raw bounds, grant/error behavior and ownership. The disclosed small/wide CPU cost and larger retained capacity are reasonable tradeoffs for substantial large-field allocation and CPU savings. No new state or reservation mechanism is added.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reviewed the complete two-file delta, all three scanner callers, admission/lease/pending-row consumers, benchmark fixtures, three discussion entries and current linked issue context.
-
Isolation preflight and three complete-parser probe roots passed: exact values/reset/lines, 20 bound/grant/denial/read-error controls, and an unchanged baseline sealed-CR panic control.
-
Frozen-source, gofmt/whitespace, unchanged reservation-owner, probe-provenance and command/source/exit/log audit passed.
-
Assessed reported owning/consumer normal/race/vet, 4,176 differential comparisons and six alternating branch-specific benchmark samples.
Limitations:
-
The probe replaces four external dependencies with documented scaffolding; native leases, full-package/race execution and real SQL/file-service behavior were not locally exercised. Author raw runtime/performance logs were unavailable.
-
Reported serial small/wide framing is approximately 3.6%/3.5% slower; retained row capacity increases. Corrected small parallel controls are inconclusive, and sibling-main RSS evidence does not establish 4.2 whole-CN or idle-memory gains.
-
Six hosted checks remain pending/queued. The pre-existing sealed-CR panic remains in this independent head and is addressed separately by #32768.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #32751. Port of main #32766.
What this PR does / why we need it:
CSV fragments spanning read blocks were assembled into a temporary growing buffer and then copied into the row buffer, repeating allocation even with a reusable row buffer. Append fragments directly into the caller-owned row/lookahead accumulator, retaining the single-block path.
Adapt the change to 4.2's raw record bounds and memory reservation callbacks. Growth grants still precede appends, and rejected lookahead preserves the prior empty-fragment error result. Keep the existing conservative reservation envelope.
Six alternating Linux/amd64 CPU benchmark samples with Go 1.26.4:
Validation: full csvparser normal/race/vet, focused external admission/reset/typed-boundary normal/race controls, 4,176 baseline/head input/config/block comparisons, and final incremental lint (0 issues). CN RSS evidence is from sibling main #32766; this port has branch-specific component and consumer validation. The pre-existing sealed-CR panic found in baseline controls is addressed independently by #32768.
Full hosted CI is pending. Maintained benchmarks cover cold/reused, small/wide/quoted/large inputs and independent concurrent readers.