Repository navigation
perf(telemetry): share the session's configuration across events instead of copying it - #471
Open
vuanhphung wants to merge 1 commit into
Open
vuanhphung wants to merge 1 commit into
vuanhphung wants to merge 1 commit into
Conversation
…ead of copying it Every statement event copied the session's DriverSystemConfiguration and DriverConnectionParameters (about sixty optional strings and nested structs) and formatted the same user agent. The session now holds both behind Arc, events share them, and serde (with its `rc` feature) serializes them as before. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
vuanhphung
requested review from
aakash-saravanan-db,
anshul-garg-databricks and
vikrantpuppala
November 15, 2026 00:55
vuanhphung
temporarily deployed
to
azure-prod
November 15, 2026 00:55 — with
GitHub Actions
Inactive
vuanhphung
temporarily deployed
to
azure-prod
November 15, 2026 00:55 — with
GitHub Actions
Inactive
vuanhphung
temporarily deployed
to
azure-prod
November 15, 2026 00:55 — with
GitHub Actions
Inactive
vuanhphung
temporarily deployed
to
azure-prod
November 15, 2026 00:55 — with
GitHub Actions
Inactive
vuanhphung
temporarily deployed
to
azure-prod
November 15, 2026 00:55 — with
GitHub Actions
Inactive
vuanhphung
temporarily deployed
to
azure-prod
November 15, 2026 00:55 — with
GitHub Actions
Inactive
vuanhphung
temporarily deployed
to
azure-prod
November 15, 2026 00:55 — with
GitHub Actions
Inactive
vuanhphung
temporarily deployed
to
azure-prod
November 15, 2026 00:55 — with
GitHub Actions
Inactive
vuanhphung
temporarily deployed
to
azure-prod
November 15, 2026 00:55 — with
GitHub Actions
Inactive
This branch was previously 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.
Problem
With telemetry on (the server enables it for the kernel), every statement event copies the session's
DriverSystemConfigurationandDriverConnectionParameters, about sixty optional strings and nested structs, and formats the same user-agent string. In a profile of one Python process runningSELECT 1on 800 threads, building and dropping those copies was 2-3% of client CPU.Fix
The session's telemetry context holds both behind
Arc, events share them, and serde'srcfeature serializes anArc<T>asT, so the exported JSON is unchanged. The user agent is a compile-time constant.Verification
cargo fmt,cargo clippy --all-targets -D warningsandcargo testpass (including the existing field-name and session telemetry JSON tests).Python driver end to end,
SELECT 1back to back in one process, on the full factory stack (#453 #455 #456 #457 #458 #459 #461 #467 #468 #469) with and without this change. Mock: a TLS server replaying the live Real-Time responses and feature flags (kernel telemetry on; execute 80 ms, close 60 ms), client on 6 cores, 3 interleaved runs, medians:Live, Medium Real-Time warehouse (server-bound at about 860 QPS), 1 × 200 threads, 60 s, 2 interleaved rounds, this PR together with #472 and #470: 0.398 → 0.386 ms client CPU per query, same QPS, same server-side error counts.
This pull request and its description were written by Isaac.