Add http/https vs fetch transport benchmark for the Node.js client#779
Draft
Copilot wants to merge 2 commits into
Draft
Add http/https vs fetch transport benchmark for the Node.js client#779Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
|
|
Copilot
AI
changed the title
[WIP] Replace legacy http/https with fetch API for improved performance
Add http/https vs fetch transport benchmark for the Node.js client
May 29, 2026
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.
Summary
The issue proposes replacing the Node.js client's legacy
http/httpstransport withfetch/undicifor performance, and the discussion asks for trustworthy comparison data before committing to a rewrite. This PR adds a reproducible benchmark that pits the current client against a trivialfetch()(undici) stub over identical requests — no transport rewrite yet, just the data to justify one.benchmarks/transport/— new benchmark:clients.ts— aTransportClientabstraction with two impls driven through the same scenarios:SdkTransportClient(@clickhouse/client, usesexec()to isolate transport from row parsing) andFetchTransportClient(minimalfetch()stub).index.ts— runner for three use cases with warmup + configurable iterations andp50/p90/p99latency: single-request latency (SELECT 1), download throughput (large result set), upload throughput (POSTtonull()so no table setup is needed). Tunable viaCLICKHOUSE_URL,LATENCY_REQUESTS,DOWNLOAD_ROWS,UPLOAD_ROWS,ITERATIONS,WARMUP.stats.ts— dependency-free latency/throughput helpers.README.md— run instructions, config, interpretation, sample local run.benchmarks/tsconfig.jsonextended a non-existent../tsconfig.json→ now../tsconfig.base.json; registerstransport/**/*.ts.benchmarks/eslint.config.mjsso benchmark files have a discoverable flat config (ESLint v10 + lint-staged otherwise error on staged benchmark files).Indicative single local run (sandbox, Node 24, loopback):
@clickhouse/client(http/https)fetch(undici) stubSELECT 1latency (mean)Early signal is a trade-off rather than a clear win:
fetchhas lower small-request latency, the existing streaming path drains large downloads faster, and uploads are server-bound for both. Numbers are environment-specific and meant to be re-run per workload.docker-compose up -d tsc --project benchmarks/tsconfig.json \ && node benchmarks/dist/benchmarks/transport/index.jsChecklist