Repository navigation
Avoid copying Thrift CloudFetch response buffers - #627
Open
vuanhphung wants to merge 2 commits into
Open
vuanhphung wants to merge 2 commits into
vuanhphung wants to merge 2 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>
This branch was successfully deployed
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.
Thrift CloudFetch's
arrayBuffer()copies node-fetch's already-consumed Buffer. A live 2.109 GB catalog-sales profile attributes 725 ms of self time to that copy; the candidate profile has zero samples there.Carry
response.buffer()directly through the Arrow handoff, removing one full-body allocation. Scheduling, concurrency 10, CloudFetch LZ4-off, retries, logging and telemetry stay unchanged. This is Thrift-only because kernel HTTP/body handling is native. There is a mechanical textual conflict with #610: whichever lands second must useconst bodyRead = response.buffer();inside its idle-timer wrapper. #623's row-limit path is untouched.Verification: 1806 unit tests (including 28 CloudFetch) and lint/format/types/build pass. A real-HTTP pooled-Arrow test catches the production-read copy mutant. Live Thrift 4/4, kernel 7/7 and full-value/null/limit parity passed on identical runtime code.
Independent adversarial measurements find 10–14% lower CPU and 7–15% lower median peak RSS on live catalog drains. Node 24.22.1; rotated fresh-process A/B, warm-ups discarded, shared live warehouse; medians:
Elapsed gains are not repeatable at 216 MB or on materialized/storage-bound results; no universal/tail speedup is claimed. Largest materializations hit the 115 s cap on both revisions. Accepted baseline: mid-download close/cancel emits one error-telemetry event on both main and branch, pre-existing on main and unchanged by this PR; neither produces ERROR logs or unhandled rejections.
Adversarial review: round 1 converged with no high findings; evidence wording corrected, production-path coverage added, and unchanged lifecycle telemetry accepted separately.
This pull request and its description were written by Isaac.