Skip to content

feat: generated execution SDK#4776

Draft
yaacovCR wants to merge 2 commits into
graphql:17.x.xfrom
yaacovCR:generate
Draft

feat: generated execution SDK#4776
yaacovCR wants to merge 2 commits into
graphql:17.x.xfrom
yaacovCR:generate

Conversation

@yaacovCR

@yaacovCR yaacovCR commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Depends on:

Add source generation for specialized execution modules.

Benchmarks were run on Node v24.14.1 against 17.x.x, with the compiled executor parent included as an additional comparison.

The generated path shows these rough ops/sec changes compared to regular execution, with percentage comparison to compilation only also included.

  • async root fields: 1,994 vs 633 ops/sec, +215% vs 17.x.x and +32% vs compiled
  • field argument values: 19,698 vs 3,556 ops/sec, +454% vs 17.x.x and +79% vs compiled
  • introspection query: 117 vs 49.8 ops/sec, +135% vs 17.x.x and +66% vs compiled
  • async list field: 9,905 vs 3,115 ops/sec, +218% vs 17.x.x and +49% vs compiled
  • async non-null list items: 9,719 vs 2,939 ops/sec, +231% vs 17.x.x and +42% vs compiled
  • sync list field: 60,523 vs 14,355 ops/sec, +321% vs 17.x.x and +38% vs compiled
  • variable field collection: 101,957 vs 5,631 ops/sec, +1,711% vs 17.x.x and +444% vs compiled

We also compared with comparable benchmarks to those used by graphql-jit. graphql-jit is still faster! The remaining performance gap possibly largely coming from preserving graphql-js 17.x null-prototype semantics for runtime maps including all results objects and all inputs.

Below numbers compare the generated SDK performance to regular execute, with percentage comparison to compilation also included.

  • few resolvers: 245,154 vs 17,336 ops/sec, +1,313% vs 17.x.x and +522% vs compiled
  • reference introspection: 3,323 vs 1,463 ops/sec, +127% vs 17.x.x and +62% vs compiled
  • many resolvers: 129,955 vs 11,138 ops/sec, +1,066% vs 17.x.x and +350% vs compiled
  • nested arrays: 872 vs 129 ops/sec, +579% vs 17.x.x and +90% vs compiled

@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

@yaacovCR is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

yaacovCR added 2 commits June 2, 2026 01:55
Add a compiled execution path for validated operations and subscriptions.

Benchmarks were run on Node v24.14.1 against 17.x.x. The compiler path shows rough ops/sec wins across the benchmark scenarios:

- async root fields: 1,511 vs 638 ops/sec, +137%
- field argument values: 11,245 vs 3,595 ops/sec, +213%
- introspection query: 70.4 vs 49.9 ops/sec, +41%
- async list field: 6,725 vs 3,083 ops/sec, +118%
- async non-null list items: 6,853 vs 2,960 ops/sec, +132%
- sync list field: 44,583 vs 14,248 ops/sec, +213%
- variable field collection: 18,498 vs 5,708 ops/sec, +224%
Add source generation for specialized execution modules.

Benchmarks were run on Node v24.14.1 against 17.x.x, with the compiled executor parent included as an additional comparison. The generated path shows these rough ops/sec changes:

- async root fields: 1,994 vs 633 ops/sec, +215% vs 17.x.x and +32% vs compiled
- field argument values: 19,698 vs 3,556 ops/sec, +454% vs 17.x.x and +79% vs compiled
- introspection query: 117 vs 49.8 ops/sec, +135% vs 17.x.x and +66% vs compiled
- async list field: 9,905 vs 3,115 ops/sec, +218% vs 17.x.x and +49% vs compiled
- async non-null list items: 9,719 vs 2,939 ops/sec, +231% vs 17.x.x and +42% vs compiled
- sync list field: 60,523 vs 14,355 ops/sec, +321% vs 17.x.x and +38% vs compiled
- variable field collection: 101,957 vs 5,631 ops/sec, +1,711% vs 17.x.x and +444% vs compiled

The generated reference benchmark scenarios mirror graphql-jit benchmark shapes, with README numbers included in the benchmark files as hardware-dependent context. The local run produced:

- few resolvers: 245,154 vs 17,336 ops/sec, +1,313% vs 17.x.x and +522% vs compiled
- reference introspection: 3,323 vs 1,463 ops/sec, +127% vs 17.x.x and +62% vs compiled
- many resolvers: 129,955 vs 11,138 ops/sec, +1,066% vs 17.x.x and +350% vs compiled
- nested arrays: 872 vs 129 ops/sec, +579% vs 17.x.x and +90% vs compiled

The main remaining performance gap to graphql-jit appears to come from preserving graphql-js 17.x null-prototype semantics not just for result objects, but also for runtime maps such as inputs, variables, and argument values.
@yaacovCR yaacovCR closed this Jun 3, 2026
@yaacovCR yaacovCR deleted the generate branch June 3, 2026 18:01
@yaacovCR yaacovCR restored the generate branch June 3, 2026 18:01
@yaacovCR yaacovCR reopened this Jun 3, 2026
@yaacovCR yaacovCR mentioned this pull request Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant