Combine row stepping and column collection - #1445
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
#1444 has been merged — thank you again! Feel free to rebase this one onto master and mark it ready for review; the incremental diff looked promising and I'll benchmark it the same way (please keep an eye out for regressions on the non-cancellable path when fusing step and column collection). |
Depends on #1444. Incremental diff. I will rebase this once the dependency PR lands.
Summary
SQLiteRows.Nextcurrently crosses cgo once to callsqlite3_stepand, for every returned row, a second time to collect its column values. This PR combines both operations in one C helper.It retains the same row buffer, conversions, error handling, and cancellation tracking; the helper collects values only when
sqlite3_stepreturnsSQLITE_ROW.Benchmarks
Apple M4 Max, Go 1.26.5, 10 interleaved runs at 500 ms per benchmark. Medians were compared with
benchstat;~means no statistically significant difference at p=0.05. Base is840a3ecand this PR is0869632.RowsContext/rows=1/context=non_cancelableRowsContext/rows=1/context=cancelableRowsContext/rows=1000/context=non_cancelableRowsContext/rows=1000/context=cancelableBenchmarkSuite/BenchmarkQueryBenchmarkSuite/BenchmarkRowsBenchmarkSuite/BenchmarkStmtRowsBytes and allocations per operation are unchanged in every measured benchmark.