Title: Fix TwitterBenchmark which only measured a validation error by Meemaw · Pull Request #4499 · graphql-java/graphql-java · GitHub
Open Graph Title: Fix TwitterBenchmark which only measured a validation error by Meemaw · Pull Request #4499 · graphql-java/graphql-java
X Title: Fix TwitterBenchmark which only measured a validation error by Meemaw · Pull Request #4499 · graphql-java/graphql-java
Description: Problem TwitterBenchmark builds a query that is 150 levels deep. Since e4c287c ("Add query depth and field count limits to Validator") validation enforces QueryComplexityLimits with a default maxDepth of 100, so every benchmark execution fails with: MaxQueryDepthExceeded: Query depth 101 exceeds maximum allowed depth 100 and returns data == null. Because the benchmark uses a persisted query cache, it has been measuring the return of a cached validation error (~8M ops/s) rather than execution, and those numbers flow into the performance results history. Fix Pass a QueryComplexityLimits with maxDepth(DEPTH + 1) through the request's GraphQLContext (QueryComplexityLimits.KEY) rather than changing the global default, so other benchmarks in the same JVM are unaffected. Execute the query once during class initialisation and fail fast if it returns errors, so the benchmark cannot silently degrade into measuring an error path again. Verification Before: query returns MaxQueryDepthExceeded, data == null; benchmark reports ~8,090,000 ops/s. After: query returns no errors and fully nested data (150 levels, 150 leaves at the bottom); benchmark reports 359 ± 12 ops/s (~2.8 ms per ~22.6k field query, Apple Silicon, JDK 21). Temporarily lowering the limit to DEPTH - 1 makes class initialisation throw ExceptionInInitializerError, confirming the fail-fast check works. graphql.archunit.* tests pass (JMH fork rule). Note: the historical TwitterBenchmark numbers recorded since the limits were introduced are not comparable with results after this change.
Open Graph Description: Problem TwitterBenchmark builds a query that is 150 levels deep. Since e4c287c ("Add query depth and field count limits to Validator") validation enforces QueryComplexityLimits with a def...
X Description: Problem TwitterBenchmark builds a query that is 150 levels deep. Since e4c287c ("Add query depth and field count limits to Validator") validation enforces QueryComplexityLimits wi...
Opengraph URL: https://github.com/graphql-java/graphql-java/pull/4499
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,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-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4acfdc06-6780-2bfb-a9c9-1b819bd2cdcd |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DC96:F7C4C:1ED03DB:2932A3A:6B017C75 |
| html-safe-nonce | f44836e4661a97adfc1c8c5470ece55d3659073a59b10a3985469df27063ea24 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzk2OkY3QzRDOjFFRDAzREI6MjkzMkEzQTo2QjAxN0M3NSIsInZpc2l0b3JfaWQiOiI0ODU0MzUwNDI1ODgzNTk3OTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2154c35ecaa8a09f6e6478311c40fcd8280ad3e22a36b36bf428c1d6e3a2e077 |
| hovercard-subject-tag | pull_request:4903399668 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/graphql-java/graphql-java/pull/4499/files |
| twitter:image | https://avatars.githubusercontent.com/u/8524109?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/8524109?s=400&v=4 |
| og:image:alt | Problem TwitterBenchmark builds a query that is 150 levels deep. Since e4c287c ("Add query depth and field count limits to Validator") validation enforces QueryComplexityLimits with a def... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/graphql-java/graphql-java git https://github.com/graphql-java/graphql-java.git |
| octolytics-dimension-user_id | 14289921 |
| octolytics-dimension-user_login | graphql-java |
| octolytics-dimension-repository_id | 38602457 |
| octolytics-dimension-repository_nwo | graphql-java/graphql-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38602457 |
| octolytics-dimension-repository_network_root_nwo | graphql-java/graphql-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width