René's URL Explorer Experiment


Title: FastSchemaValidator by xuorig · Pull Request #4549 · graphql-java/graphql-java · GitHub

Open Graph Title: FastSchemaValidator by xuorig · Pull Request #4549 · graphql-java/graphql-java

X Title: FastSchemaValidator by xuorig · Pull Request #4549 · graphql-java/graphql-java

Description: Introduces a FastSchemaValidator, which doesn't use SchemaTraverser. Running locally, I achieve ~20x speedup compared to SchemaValidator. I've chosen to introduce it as the default validator for the FastBuilder. For correctness, with the help of Opus I've ran every single GraphQLSchema build in the test suite with both validators and they came back with the same set of errors. I added a new set of comparison tests too (similar to FastBuilder) for correctness and making sure they stay aligned. A benchmark was also added. Let me know how you want to handle this, we could: Make this one the default everywhere right now Make it the default in fast builder (CURRENT IMPLEMENTATION) Keep it outside both builders for now, can only be used "manually" through experimental API. Local Results: Setup: JMH 1.37, JDK 25.0.2 (OpenJDK 64-Bit Server VM) on my macOS machine. 2 forks, 2 warmup iterations of 5 s, 3 measurement iterations of 10 s, GC profiler on. ./gradlew jmh -PjmhInclude='SchemaValidatorBenchmark' -PjmhProfilers=gc Benchmark (schemaFile) Mode Cnt Score Error Units SchemaValidatorBenchmark.fastSchemaValidator large-schema-4.graphqls avgt 6 15.579 ± 1.665 ms/op SchemaValidatorBenchmark.fastSchemaValidator:gc.alloc.rate large-schema-4.graphqls avgt 6 716.824 ± 72.763 MB/sec SchemaValidatorBenchmark.fastSchemaValidator:gc.alloc.rate.norm large-schema-4.graphqls avgt 6 11696271.545 ± 10091.025 B/op SchemaValidatorBenchmark.fastSchemaValidator:gc.count large-schema-4.graphqls avgt 6 57.000 counts SchemaValidatorBenchmark.fastSchemaValidator:gc.time large-schema-4.graphqls avgt 6 43.000 ms SchemaValidatorBenchmark.fastSchemaValidator large-schema-federated-1.graphqls avgt 6 16.900 ± 2.487 ms/op SchemaValidatorBenchmark.fastSchemaValidator:gc.alloc.rate large-schema-federated-1.graphqls avgt 6 452.646 ± 62.060 MB/sec SchemaValidatorBenchmark.fastSchemaValidator:gc.alloc.rate.norm large-schema-federated-1.graphqls avgt 6 8004115.706 ± 74511.963 B/op SchemaValidatorBenchmark.fastSchemaValidator:gc.count large-schema-federated-1.graphqls avgt 6 26.000 counts SchemaValidatorBenchmark.fastSchemaValidator:gc.time large-schema-federated-1.graphqls avgt 6 127.000 ms SchemaValidatorBenchmark.schemaValidator large-schema-4.graphqls avgt 6 383.427 ± 13.434 ms/op SchemaValidatorBenchmark.schemaValidator:gc.alloc.rate large-schema-4.graphqls avgt 6 1323.517 ± 52.054 MB/sec SchemaValidatorBenchmark.schemaValidator:gc.alloc.rate.norm large-schema-4.graphqls avgt 6 532055193.398 ± 2804385.051 B/op SchemaValidatorBenchmark.schemaValidator:gc.count large-schema-4.graphqls avgt 6 256.000 counts SchemaValidatorBenchmark.schemaValidator:gc.time large-schema-4.graphqls avgt 6 9077.000 ms SchemaValidatorBenchmark.schemaValidator large-schema-federated-1.graphqls avgt 6 309.378 ± 15.368 ms/op SchemaValidatorBenchmark.schemaValidator:gc.alloc.rate large-schema-federated-1.graphqls avgt 6 1247.296 ± 69.868 MB/sec SchemaValidatorBenchmark.schemaValidator:gc.alloc.rate.norm large-schema-federated-1.graphqls avgt 6 404519204.968 ± 3888410.861 B/op SchemaValidatorBenchmark.schemaValidator:gc.count large-schema-federated-1.graphqls avgt 6 230.000 counts SchemaValidatorBenchmark.schemaValidator:gc.time large-schema-federated-1.graphqls avgt 6 6366.000 ms TL;DR ┌──────────────────────────┬─────────────────┬─────────────────────┬─────────┬──────────────────────────┐ │ Schema │ SchemaValidator │ FastSchemaValidator │ Speedup │ Memory allocated per run │ ├──────────────────────────┼─────────────────┼─────────────────────┼─────────┼──────────────────────────┤ │ large-schema-4 │ 383.4 ± 13.4 ms │ 15.6 ± 1.7 ms │ ~25× │ 532 MB → 11.7 MB │ ├──────────────────────────┼─────────────────┼─────────────────────┼─────────┼──────────────────────────┤ │ large-schema-federated-1 │ 309.4 ± 15.4 ms │ 16.9 ± 2.5 ms │ ~18× │ 405 MB → 8.0 MB │ └──────────────────────────┴─────────────────┴─────────────────────┴─────────┴──────────────────────────┘

Open Graph Description: Introduces a FastSchemaValidator, which doesn't use SchemaTraverser. Running locally, I achieve ~20x speedup compared to SchemaValidator. I've chosen to introduce it as the default validato...

X Description: Introduces a FastSchemaValidator, which doesn't use SchemaTraverser. Running locally, I achieve ~20x speedup compared to SchemaValidator. I've chosen to introduce it as the default ...

Opengraph URL: https://github.com/graphql-java/graphql-java/pull/4549

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e5013ed9-93de-57a1-dc74-f7f680c86426
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDCAE:3E4205:1F16532:2988DF2:6B017C77
html-safe-nonce3594557824922ef298f13d9bfb1644bdf7befc6b76b0a134e093ab5005b57a7c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQ0FFOjNFNDIwNToxRjE2NTMyOjI5ODhERjI6NkIwMTdDNzciLCJ2aXNpdG9yX2lkIjoiMTc1MzY0NjM4NDM4NjUwNTg0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacd2486f31c3f161d76a1de1014805f682e8f1e0bac5114aacdfabd6f7217bb980
hovercard-subject-tagpull_request:5244133980
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/graphql-java/graphql-java/pull/4549/files
twitter:imagehttps://avatars.githubusercontent.com/u/1919498?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1919498?s=400&v=4
og:image:altIntroduces a FastSchemaValidator, which doesn't use SchemaTraverser. Running locally, I achieve ~20x speedup compared to SchemaValidator. I've chosen to introduce it as the default validato...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/graphql-java/graphql-java git https://github.com/graphql-java/graphql-java.git
octolytics-dimension-user_id14289921
octolytics-dimension-user_logingraphql-java
octolytics-dimension-repository_id38602457
octolytics-dimension-repository_nwographql-java/graphql-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id38602457
octolytics-dimension-repository_network_root_nwographql-java/graphql-java
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/graphql-java/graphql-java/pull/4549/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fgraphql-java%2Fpull%2F4549%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgraphql-java%2Fgraphql-java%2Fpull%2F4549%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=graphql-java%2Fgraphql-java
Reloadhttps://github.com/graphql-java/graphql-java/pull/4549/files
Reloadhttps://github.com/graphql-java/graphql-java/pull/4549/files
Reloadhttps://github.com/graphql-java/graphql-java/pull/4549/files
graphql-javahttps://github.com/graphql-java
graphql-javahttps://github.com/graphql-java/graphql-java
Codehttps://github.com/graphql-java/graphql-java
Issues27 (27)https://github.com/graphql-java/graphql-java/issues
Pull requests35 (35)https://github.com/graphql-java/graphql-java/pulls
Discussionshttps://github.com/graphql-java/graphql-java/discussions
Actionshttps://github.com/graphql-java/graphql-java/actions
Projectshttps://github.com/graphql-java/graphql-java/projects
Wikihttps://github.com/graphql-java/graphql-java/wiki
Security and qualityhttps://github.com/graphql-java/graphql-java/security
Insightshttps://github.com/graphql-java/graphql-java/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fgraphql-java%2Fgraphql-java%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgraphql-java%2Fgraphql-java%2Fissues%2Fnew%2Fchoose
xuorighttps://github.com/xuorig
graphql-java:masterhttps://github.com/graphql-java/graphql-java/tree/master
xuorig:fast-schema-validatorhttps://github.com/xuorig/graphql-java/tree/fast-schema-validator
Conversation 13 https://github.com/graphql-java/graphql-java/pull/4549
Commits 2 https://github.com/graphql-java/graphql-java/pull/4549/commits
Checks 9 https://github.com/graphql-java/graphql-java/pull/4549/checks
Files changed https://github.com/graphql-java/graphql-java/pull/4549/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/4549/files
FastSchemaValidator https://github.com/graphql-java/graphql-java/pull/4549/files#top
Show all changes 2 commits https://github.com/graphql-java/graphql-java/pull/4549/files
1bdb449 Make SchemaValidator a single pass over types instead of a SchemaTrav… xuorig Nov 11, 2026 https://github.com/graphql-java/graphql-java/pull/4549/commits/1bdb449e51bb6a38b7d78c4b0efed85cfac4b055
56c99ea Split SchemaValidator rules into SchemaValidationRule classes xuorig Nov 11, 2026 https://github.com/graphql-java/graphql-java/pull/4549/commits/56c99ea01d85aaa1bf2e10d0c32b256a7dc98348
Clear filters https://github.com/graphql-java/graphql-java/pull/4549/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/4549/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/4549/files
SchemaValidatorBenchmark.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-4a65cec2a62f4560a909c1cfce54efecea74b0d4038ed5631574172c1babebdd
AppliedDirectiveArgumentsAreValid.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-ae3f95bf487dda61da2b8a799f3f44f348b927049cb44743f186a1bf94db202b
AppliedDirectivesAreValid.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-b1119ee1b1f5c58b41377212e0a23fd5d02a591b122b00d809bbacfffd8cc688
DefaultValuesAreValid.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-f3665dc61eed591657753e75e2239e288f4c696a9ee654b73b6dfa7644fa9827
DeprecatedInputObjectAndArgumentsAreValid.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-932458402c08bacca2b69f964be5649cf6015a66aa819b78782275106f564958
InputAndOutputTypesUsedAppropriately.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-5caf8053f8554d013a1c13f17776c9c42b3ecd978213445cc0063d28c7f081b0
InputValueValidator.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-7d362ec0111347b5105d103e344361e9b9ed44b023049e14f650c1229cdc2cb6
NoDefaultValueCircularRefs.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-3632ac24a39cb30dc4901f8d09f502139b8cf6be9c4d655464462b9899e69a54
NoUnbrokenInputCycles.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-1279d58384cd877b6af6475146078d293ba351252c2884b4c0688e3fca3e7b63
OneOfInputObjectRules.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-1054a5fe3d39926e85101f3083311046b9f87a32071cbdf50869cbfaac178df4
SchemaValidationRule.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-44d04ee3a57441e503ba4e7f401f0d41435424196743411dc9c2c986421137af
SchemaValidator.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-c61128ed45b5042860e141f937a41901bfd98ce1561c282107e8f51c7d762035
TypeAndFieldRule.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-1a19e9c91e2618b7797153d31bfc12a385008518f41ce94371ceb1eb3c68e704
TypesImplementInterfaces.java https://github.com/graphql-java/graphql-java/pull/4549/files#diff-d7b59e9ffa2734af2d2f7d808f53f58a717c9db19ed7b71bc66d2e00b61cdc55
CircularInputDefaultValuesTest.groovy https://github.com/graphql-java/graphql-java/pull/4549/files#diff-ea435b9661f665ddaea91ccd31fe6294902841eefb2b04c414a3372c829d1637
InterfacesImplementingInterfacesTest.groovy https://github.com/graphql-java/graphql-java/pull/4549/files#diff-ad495327860e74a6c717a57518ff1ea6fa354166569def768e9bb2690193326c
FastBuilderTest.groovy https://github.com/graphql-java/graphql-java/pull/4549/files#diff-a255416df7a4b76fcb933f63127eaa0608d949fc607f951d8df60267e915f3eb
SchemaTraverserTest.groovy https://github.com/graphql-java/graphql-java/pull/4549/files#diff-832d435b1d490b7a3ed057e8d4d4770ad247486773fe818cf893883b738b862f
InputAndOutputTypesUsedAppropriatelyTest.groovy https://github.com/graphql-java/graphql-java/pull/4549/files#diff-c6cbd913cd483915931a54026c2531234caee6df4e964d77bc80848625116edf
NoDefaultValueCircularRefsTest.groovy https://github.com/graphql-java/graphql-java/pull/4549/files#diff-835bbc969285cd4534e681979cafc50064e8f0a76f79ae967eb65d62b09a3d29
NoUnbrokenInputCyclesTest.groovy https://github.com/graphql-java/graphql-java/pull/4549/files#diff-ac8960143a42a0f615e3a782f3246cf1e3567d793cf97215393a9c462ac07bde
SchemaValidationErrorCollectorTest.groovy https://github.com/graphql-java/graphql-java/pull/4549/files#diff-53dc33eadd602115b6f4dfa5b1a10cf1386900e71336bb453c3d6119a79bad30
SchemaValidatorTest.groovy https://github.com/graphql-java/graphql-java/pull/4549/files#diff-05d8104f949be383f380a7f78a265bda004f807396548ff874d6b2337376db70
TypeAndFieldRuleTest.groovy https://github.com/graphql-java/graphql-java/pull/4549/files#diff-8f6dfee373d01144a489e4555e831ba924e7098df105cb94708878fe49937b3c
TypesImplementInterfacesTest.groovy https://github.com/graphql-java/graphql-java/pull/4549/files#diff-b0010bf336a9032f22279338d5dc7012144ba62e5409aa3e506e970d34a2c06a
src/jmh/java/benchmark/SchemaValidatorBenchmark.javahttps://github.com/graphql-java/graphql-java/pull/4549/files#diff-4a65cec2a62f4560a909c1cfce54efecea74b0d4038ed5631574172c1babebdd
View file https://github.com/graphql-java/graphql-java/blob/56c99ea01d85aaa1bf2e10d0c32b256a7dc98348/src/jmh/java/benchmark/SchemaValidatorBenchmark.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/graphql-java/graphql-java/pull/4549/{{ revealButtonHref }}
src/main/java/graphql/schema/validation/AppliedDirectiveArgumentsAreValid.javahttps://github.com/graphql-java/graphql-java/pull/4549/files#diff-ae3f95bf487dda61da2b8a799f3f44f348b927049cb44743f186a1bf94db202b
View file https://github.com/graphql-java/graphql-java/blob/56c99ea01d85aaa1bf2e10d0c32b256a7dc98348/src/main/java/graphql/schema/validation/AppliedDirectiveArgumentsAreValid.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/graphql-java/graphql-java/pull/4549/{{ revealButtonHref }}
src/main/java/graphql/schema/validation/AppliedDirectivesAreValid.javahttps://github.com/graphql-java/graphql-java/pull/4549/files#diff-b1119ee1b1f5c58b41377212e0a23fd5d02a591b122b00d809bbacfffd8cc688
View file https://github.com/graphql-java/graphql-java/blob/56c99ea01d85aaa1bf2e10d0c32b256a7dc98348/src/main/java/graphql/schema/validation/AppliedDirectivesAreValid.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/graphql-java/graphql-java/pull/4549/{{ revealButtonHref }}
https://github.com/graphql-java/graphql-java/pull/4549/files#diff-b1119ee1b1f5c58b41377212e0a23fd5d02a591b122b00d809bbacfffd8cc688
src/main/java/graphql/schema/validation/DefaultValuesAreValid.javahttps://github.com/graphql-java/graphql-java/pull/4549/files#diff-f3665dc61eed591657753e75e2239e288f4c696a9ee654b73b6dfa7644fa9827
View file https://github.com/graphql-java/graphql-java/blob/56c99ea01d85aaa1bf2e10d0c32b256a7dc98348/src/main/java/graphql/schema/validation/DefaultValuesAreValid.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/graphql-java/graphql-java/pull/4549/{{ revealButtonHref }}
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/4549/files
Please reload this pagehttps://github.com/graphql-java/graphql-java/pull/4549/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.