Skip to content

[DO NOT MERGE] Schema traverser perf #4232

Draft
andimarek wants to merge 2 commits intomasterfrom
schema-traverser-perf
Draft

[DO NOT MERGE] Schema traverser perf #4232
andimarek wants to merge 2 commits intomasterfrom
schema-traverser-perf

Conversation

@andimarek
Copy link
Member

No description provided.

andimarek-atlassian and others added 2 commits January 29, 2026 20:26
Adds benchmark to compare built-in SchemaTraverser.depthFirstFullSchema()
with manual recursive traversal using direct iteration over
schema.getAllTypesAsList().

Results show manual traversal is ~13x faster for steady-state and ~3.5x
faster for cold-start, while counting the same 5030 schema elements.

- SchemaTraversalBenchmark: JMH benchmark with both approaches
- SchemaTraversalVerificationTest: Verifies both count identical elements
- build.gradle: Add JMH include filter configuration

Co-authored-by: Cursor <cursoragent@cursor.com>
Enable passing profilers via -Pjmh.profilers (e.g., 'gc' for memory profiling).

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions
Copy link
Contributor

github-actions bot commented Jan 29, 2026

Test Results

  328 files  +1    328 suites  +1   5m 8s ⏱️ -2s
5 251 tests +1  5 242 ✅ +1  9 💤 ±0  0 ❌ ±0 
5 340 runs  +1  5 331 ✅ +1  9 💤 ±0  0 ❌ ±0 

Results for commit 81fb886. ± Comparison against base commit 7ba1647.

This pull request removes 196 and adds 173 tests. Note that renamed tests count towards both.
	?

	, expected: combo-\"\\\b\f\n\r\t, #4]
                __schema { types { fields { args { type { name fields { name }}}}}}
                __schema { types { fields { type { name fields { name }}}}}
                __schema { types { inputFields { type { inputFields { name }}}}}
                __schema { types { interfaces { fields { type { interfaces { name } } } } } }
                __schema { types { name} }
                __type(name : "t") { name }
                a1: __schema { types { name} }
                a1: __type(name : "t") { name }
…
benchmark.SchemaTraversalVerificationTest ‑ compareTraversalCounts()
graphql.AssertTest ‑ assertFalse with different number of error args but false does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_21prov0_closure23@80bfdc6 delegate=graphql.AssertTest@5ec4ff02 owner=graphql.AssertTest@5ec4ff02 thisObject=graphql.AssertTest@5ec4ff02 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
graphql.AssertTest ‑ assertFalse with different number of error args but false does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_21prov0_closure24@6edcad64 delegate=graphql.AssertTest@5ec4ff02 owner=graphql.AssertTest@5ec4ff02 thisObject=graphql.AssertTest@5ec4ff02 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2, #1]
graphql.AssertTest ‑ assertFalse with different number of error args but false does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_21prov0_closure25@4c6007fb delegate=graphql.AssertTest@5ec4ff02 owner=graphql.AssertTest@5ec4ff02 thisObject=graphql.AssertTest@5ec4ff02 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2 arg3, #2]
graphql.AssertTest ‑ assertFalse with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_20prov0_closure20@cdb2d95 delegate=graphql.AssertTest@5ec4ff02 owner=graphql.AssertTest@5ec4ff02 thisObject=graphql.AssertTest@5ec4ff02 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
graphql.AssertTest ‑ assertFalse with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_20prov0_closure21@122d6c22 delegate=graphql.AssertTest@5ec4ff02 owner=graphql.AssertTest@5ec4ff02 thisObject=graphql.AssertTest@5ec4ff02 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2, #1]
graphql.AssertTest ‑ assertFalse with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_20prov0_closure22@2f5ac102 delegate=graphql.AssertTest@5ec4ff02 owner=graphql.AssertTest@5ec4ff02 thisObject=graphql.AssertTest@5ec4ff02 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2 arg3, #2]
graphql.AssertTest ‑ assertNotNull with different number of  error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_5prov0_closure3@75483843 delegate=graphql.AssertTest@5ec4ff02 owner=graphql.AssertTest@5ec4ff02 thisObject=graphql.AssertTest@5ec4ff02 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
graphql.AssertTest ‑ assertNotNull with different number of  error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_5prov0_closure4@36417a54 delegate=graphql.AssertTest@5ec4ff02 owner=graphql.AssertTest@5ec4ff02 thisObject=graphql.AssertTest@5ec4ff02 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2, #1]
graphql.AssertTest ‑ assertNotNull with different number of  error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_5prov0_closure5@4b6d92e delegate=graphql.AssertTest@5ec4ff02 owner=graphql.AssertTest@5ec4ff02 thisObject=graphql.AssertTest@5ec4ff02 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2 arg3, #2]
…

♻️ This comment has been updated with latest results.

@andimarek andimarek changed the title Schema traverser perf [DO NOT MERGE] Schema traverser perf Jan 29, 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.

2 participants