Parallelize generated source file writes - #963
Merged
Merged
Conversation
iuliiasobolevska
requested review from
paulbakker and
srinivasankavitha
as code owners
September 21, 2026 23:03
iuliiasobolevska
requested review from
iparadiso,
jjacobs44,
kilink and
kzwang
as code owners
September 21, 2026 23:03
paulbakker
approved these changes
Sep 21, 2026
jiholee17
approved these changes
Sep 22, 2026
This branch is waiting to be 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.
Summary
min(availableProcessors, 8), configurable throughCodeGenConfig, the Gradle task, and--file-write-parallelism; setting it to1preserves serial writingPerformance
The results vary with how much of a workload is output rendering and disk emission.
Consumer schema
The 3.7 MB consumer schema generated 9,000 files. Median CLI generation time improved from 5.06 s to 3.94 s, a 22% reduction, with byte-identical output across all files.
Adversarial synthetic benchmark
The review benchmark used 300 object types with 15 fields each, client API and interfaces enabled, and produced 1,502 files. It ran three warmed iterations for each setting:
CodeGen.generate()The synthetic result shows that this change only accelerates emission; parsing and model construction remain serial and dominate schemas where writing is a small fraction of total time.
Behavior changes
Verification
write()throws.:graphql-dgs-codegen-core:testpasses.:graphql-dgs-codegen-gradle:testpasses.