Repository navigation
perf(kernel): bind typed cell readers once per batch - #601
Closed
vuanhphung wants to merge 4 commits into
Closed
vuanhphung wants to merge 4 commits into
vuanhphung wants to merge 4 commits into
Conversation
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
vuanhphung
marked this pull request as ready for review
November 27, 2026 07:28
Collaborator
Author
|
Closing: the reproduced gain (~4% CPU on the kernel row path) is below our 5% bar for this change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kernel row iteration repeats Arrow dispatch and null/accessor checks per cell (
scanCell, including decimal formatting, accounts for 54.1% of the 500 MB profile). Independent review reproduced about 4% less catalog user CPU across 28 fresh-process pairs: 5.385 → 5.165 s, with a paired bootstrap 95% CI of -4.9% to -2.9%. Elapsed improves 2–7% depending on cohort. The 0.220 s CPU saving is 2.04 ns/cell, or about 70 ns/row against main's 1.70 µs/row.Bind scalar readers once per column per batch, lazily on the first row, and clear their references before batch release. Preserve native widths, NTZ/location decisions, string cloning, wrapped errors, options and existing decimal/nested/geospatial scanning. Only the kernel uses the helper; Thrift and defaults are unchanged. Reader state stays O(columns); a one-row batch adds 28 ns/56 B, with no resolvable change for small live queries. This is separate from #600's fetch change, #599's parked decimal arena and #514's IPC work.
Verification: default/tagged kernel suites, touched-package race and lint; parity/lifecycle tests kill 16 non-equivalent mutants, including missing-bitmap/schema-count guards. C Data sliced-record parity covers nullable and absent-bitmap columns. Eight full-result checksum pairs match, including nulls/limits/close/cancel. Live kernel/type parity passes 18/19 (the unrelated telemetry failure reproduces on main); six Thrift e2e tests pass without skips.
Adversarial review: converged in round 1; conservative results and all agreed findings addressed. Two-model/judge bot review approved cf3e9f9 with no issues.
This pull request and its description were written by Isaac.