Benchmarks
What an SDK costs. Measured, not promised.
Two questions a generated SDK has to answer: how much of your bundle does importing one operation drag in, and how much CPU does calling it burn once the network is out of the picture. These are the numbers, straight from the harnesses in benches/.
Bundle size
Import one operation, pay for one operation.
Each row is a small worker that imports a single Distilled operation and calls it, bundled the way Alchemy bundles for Cloudflare Workers. Deep and barrel imports produce the same bytes; the two rows marked * import more than that on purpose.
aws-s3-deep@distilled.cloud/aws/s3+/Credentials, one op (GetObject)118.4 KB gzip410.7 KB raw222 modules1/112 aws/s3no leaksaws-s3-deep+nopure@distilled.cloud/aws/s3+/Credentials, one op (GetObject)118.9 KB gzip412.3 KB raw222 modules1/112 aws/s3no leaksaws-barrel@distilled.cloud/awsroot barrel (+/s3deep) — same op118.7 KB gzip410.7 KB raw222 modules1/112 aws/s3no leaksaws-services-index*@distilled.cloud/aws/index— all ~430 services as namespaces, only S3.getObject used118.4 KB gzip410.7 KB raw222 modules1/112 aws/s3no leakscf-workers-deep@distilled.cloud/cloudflare/workers+/Credentials, one paginated op (listScripts)61.7 KB gzip222.2 KB raw106 modules1/74 cloudflare/workersno leakscf-workers-deep+nopure@distilled.cloud/cloudflare/workers+/Credentials, one paginated op (listScripts)62.6 KB gzip225.2 KB raw106 modules1/74 cloudflare/workersno leakscf-barrel@distilled.cloud/cloudflareroot barrel (Services.* — ~120 services), same op61.7 KB gzip222.2 KB raw106 modules1/74 cloudflare/workersno leakscombined-worker*alchemy-worker-shaped: s3.getObject + workers.listScripts (two deep imports)129.7 KB gzip464.8 KB raw234 modules1/112 aws/s31/74 cloudflare/workersno leaks
* aws-services-index imports all ~430 AWS services as namespaces; combined-worker calls two operations, one per provider. Every other row imports and calls exactly one.
rolldown 1.2.5 · bun 1.3.13 · Intel(R) Core(TM) Ultra X7 358H · 3 runs · 2026-09-09 · adc438102
Runtime
Per call, with the network removed.
The HTTP client is mocked, so this is only the SDK's own work: encode, sign, serialize, parse, decode. Lower is better, so rows run fastest p50 first; the faint bar on Full call rows is the mocked round-trip with no SDK at all.
| operation | p50 | p99 | relative p50 |
|---|---|---|---|
cloudflarekv.createNamespace3-field envelope | 31 µs | 43 µs | |
cloudflarer2.createBucket5-field envelope | 34 µs | 36 µs | |
cloudflared1.createDatabase7-field envelope | 37 µs | 39 µs | |
cloudflareworkers.putScriptSecretEnvelopePayloadRoot response | 37 µs | 242 µs | |
cloudflarekv.listNamespacespaginated protocol, 20-namespace envelope | 40 µs | 268 µs | |
cloudflared1.listDatabasespaginated protocol, 20-db envelope | 49 µs | 247 µs | |
cloudflarezones.createZone~30-field envelope | 51 µs | 314 µs | |
cloudflarer2.listBuckets20-bucket envelope | 51 µs | 292 µs | |
cloudflarezones.listZonespaginated protocol, 20-zone envelope | 273 µs | 856 µs | |
awss3.HeadObjectrest-xml + SigV4, header-only 200 | 374 µs | 4.7 ms | |
cloudflareworkers.listScriptspaginated protocol, 20-script envelope | 401 µs | 1.2 ms | |
awssts.GetCallerIdentityaws-query + SigV4, XML result | 442 µs | 2.4 ms | |
awslambda.Invokerest-json + SigV4 (signed payload), streamed response | 547 µs | 3.5 ms | |
awsdynamodb.GetItemaws-json + SigV4, 7-attr item | 547 µs | 3.5 ms | |
awsdynamodb.PutItemaws-json + SigV4, 7-attr item | 597 µs | 3.7 ms | |
awslambda.GetFunctionrest-json + SigV4, full config body | 685 µs | 3.5 ms | |
awss3.ListBucketsrest-xml + SigV4, 20-bucket XML body | 912 µs | 5.0 ms |
bun 1.3.13 · Intel(R) Core(TM) Ultra X7 358H · quick profile · 2026-09-09 · 9b3f5da1d
Method — how this is measured
- Bundle. A tiny worker-shaped entry imports one Distilled operation and calls it, bundled with rolldown using the same options Alchemy uses for Cloudflare Workers:
bunresolve conditions, minified single ESM chunk, PURE annotations on. Size is the chunk; gzip is what the wire sees. Tree-shake quality is the number of operations that survive minification out of the service's total, with a check that no other service or provider leaked in. - Runtime. The
HttpClientis replaced by one that returns a canned response, so what remains is the SDK's own work: schema encode, request build (including SigV4 for AWS), response parse, envelope decode, retry wrapper. Numbers are per call, measured with mitata on Bun. The baseline row is the mocked round-trip with no SDK in the loop; subtract it to see the SDK's share. - Caveats. One developer machine, quick profile. Bytes are stable; timings move ±30% between runs and machines. Nothing here is compared against a vendor SDK yet. Treat it as a shape, not a guarantee.
- Reproduce:
pnpm bench:bundleandpnpm bench:runtimefrom the repo root.