Skip to content

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.

118.4 KBgzipped, one S3 operation
61.7 KBgzipped, one Workers operation
129.7 KBgzipped, S3 + Workers together
  • aws-s3-deep@distilled.cloud/aws/s3 + /Credentials, one op (GetObject)
    118.4 KB gzip410.7 KB raw222 modules
    1/112 aws/s3no leaks
  • aws-s3-deep+nopure@distilled.cloud/aws/s3 + /Credentials, one op (GetObject)
    118.9 KB gzip412.3 KB raw222 modules
    1/112 aws/s3no leaks
  • aws-barrel@distilled.cloud/aws root barrel (+ /s3 deep) — same op
    118.7 KB gzip410.7 KB raw222 modules
    1/112 aws/s3no leaks
  • aws-services-index*@distilled.cloud/aws/index — all ~430 services as namespaces, only S3.getObject used
    118.4 KB gzip410.7 KB raw222 modules
    1/112 aws/s3no leaks
  • cf-workers-deep@distilled.cloud/cloudflare/workers + /Credentials, one paginated op (listScripts)
    61.7 KB gzip222.2 KB raw106 modules
    1/74 cloudflare/workersno leaks
  • cf-workers-deep+nopure@distilled.cloud/cloudflare/workers + /Credentials, one paginated op (listScripts)
    62.6 KB gzip225.2 KB raw106 modules
    1/74 cloudflare/workersno leaks
  • cf-barrel@distilled.cloud/cloudflare root barrel (Services.* — ~120 services), same op
    61.7 KB gzip222.2 KB raw106 modules
    1/74 cloudflare/workersno leaks
  • combined-worker*alchemy-worker-shaped: s3.getObject + workers.listScripts (two deep imports)
    129.7 KB gzip464.8 KB raw234 modules
    1/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.

10 µsmock round-trip, no SDK
31 µscloudflare createNamespace · p50
442 µsaws GetCallerIdentity · p50 (SigV4)
operationp50p99relative p50
cloudflarekv.createNamespace3-field envelope31 µs43 µs
cloudflarer2.createBucket5-field envelope34 µs36 µs
cloudflared1.createDatabase7-field envelope37 µs39 µs
cloudflareworkers.putScriptSecretEnvelopePayloadRoot response37 µs242 µs
cloudflarekv.listNamespacespaginated protocol, 20-namespace envelope40 µs268 µs
cloudflared1.listDatabasespaginated protocol, 20-db envelope49 µs247 µs
cloudflarezones.createZone~30-field envelope51 µs314 µs
cloudflarer2.listBuckets20-bucket envelope51 µs292 µs
cloudflarezones.listZonespaginated protocol, 20-zone envelope273 µs856 µs
awss3.HeadObjectrest-xml + SigV4, header-only 200374 µs4.7 ms
cloudflareworkers.listScriptspaginated protocol, 20-script envelope401 µs1.2 ms
awssts.GetCallerIdentityaws-query + SigV4, XML result442 µs2.4 ms
awslambda.Invokerest-json + SigV4 (signed payload), streamed response547 µs3.5 ms
awsdynamodb.GetItemaws-json + SigV4, 7-attr item547 µs3.5 ms
awsdynamodb.PutItemaws-json + SigV4, 7-attr item597 µs3.7 ms
awslambda.GetFunctionrest-json + SigV4, full config body685 µs3.5 ms
awss3.ListBucketsrest-xml + SigV4, 20-bucket XML body912 µs5.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: bun resolve 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 HttpClient is 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:bundle and pnpm bench:runtime from the repo root.