Skip to content

perf(reader): avoid copying inline Arrow results - #401

Merged
vuanhphung merged 1 commit into
mainfrom
fix/inline-result-copies
Oct 16, 2026
Merged

vuanhphung merged 1 commit into
mainfrom
fix/inline-result-copies

Conversation

@vuanhphung

Copy link
Copy Markdown
Collaborator

Inline Arrow results copied each multi-MB response four extra times. Parse response bytes directly, decode base64 attachments through a serde visitor, and move or borrow buffers through the inline readers. Error messages still include the response body, and attachment validation is preserved.

Prior measurements at 32 connections on the inline workload showed about 7% lower CPU/query and 33% higher throughput for Python, and 10% lower CPU/query and 6% higher throughput for Go; Node was unchanged. Peak memory fell about 13% for Python and 2% for Go. This primarily improves CPU cost and latency, with a modest memory gain. See the memory write-up for context.

Validation: cargo +stable fmt --all, cargo clippy --all-targets -- -D warnings, and full cargo test, including doc tests. New coverage checks escaped JSON attachments, invalid base64, and non-string attachments.

This pull request and its description were written by Isaac.

Parse response bytes directly, decode base64 attachments from JSON strings,
and move or borrow buffers through inline result readers.

Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

@vuanhphung vuanhphung added the integration-test Maintainer-only: triggers cross-repo integration tests. Auto-removed on push for re-review. label Oct 16, 2026

@aakash-saravanan-db aakash-saravanan-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Checked buffer lifetimes and attachment validation, and confirmed the Python connector's PyO3 call path is unaffected by the constructor signature change.

@github-actions

Copy link
Copy Markdown

Kernel integration tests triggered. View status. Results post back here as the "Kernel Integration Tests" check.

@vuanhphung
vuanhphung added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit d5faf22 Oct 16, 2026
26 of 27 checks passed
@vuanhphung
vuanhphung deleted the fix/inline-result-copies branch October 16, 2026 21:14

This branch was previously deployed

1 inactive deployment
azure-prod — cca078f4 Deployed Oct 16, 2026 by vuanhphung via review #930
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-test Maintainer-only: triggers cross-repo integration tests. Auto-removed on push for re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants