Skip to content

[codex] batch row column fetches in Next#1383

Merged
mattn merged 1 commit intomasterfrom
codex/next-row-batch-fetch
Apr 3, 2026
Merged

[codex] batch row column fetches in Next#1383
mattn merged 1 commit intomasterfrom
codex/next-row-batch-fetch

Conversation

@mattn
Copy link
Copy Markdown
Owner

@mattn mattn commented Apr 3, 2026

This change reduces cgo traffic in Rows.Next by fetching one row's column metadata and raw values in a single C helper call before converting them on the Go side.

Measured on the same machine with go test -run '^$' -bench 'BenchmarkSuite/(BenchmarkRows|BenchmarkStmtRows)$' -benchmem:

benchmark before after delta
BenchmarkRows 143348 ns/op 135534 ns/op -5.5%
BenchmarkStmtRows 137675 ns/op 131549 ns/op -4.5%

Allocations and bytes stayed flat:

benchmark before allocs after allocs before bytes after bytes
BenchmarkRows 524 524 11128 B/op 11128 B/op
BenchmarkStmtRows 523 523 11104 B/op 11104 B/op

Validated with go test ./... and go test -run '^$' -bench 'BenchmarkSuite/(BenchmarkRows|BenchmarkStmtRows)$' -benchmem.

@mattn mattn marked this pull request as ready for review April 3, 2026 03:57
@mattn mattn merged commit b23d54c into master Apr 3, 2026
20 checks passed
@mattn mattn deleted the codex/next-row-batch-fetch branch April 3, 2026 08:39
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