Skip to content

Conversation

@corydolphin
Copy link
Contributor

@corydolphin corydolphin commented Jan 6, 2026

Prepares AST for immutability by using tuples instead of lists for
collection fields. This aligns with the JavaScript GraphQL library
which uses readonly arrays, and enables future frozen datastructures.

Note: It looks like you can't easily make stacked PRs in an open source repo you do not have write access to, since the merge base does not exist in the remote.

Introduce benchmarks using a large (~117KB) GraphQL query to measure
parse and pickle serialization performance. These provide a baseline
for comparing serialization approaches in subsequent commits.

Baseline performance (measrued on a Macbook Pro M4 Max):
- Parse:         81ms
- Pickle encode: 24ms
- Pickle decode: 42ms
- Roundtrip:     71ms
Prepares AST for immutability by using tuples instead of lists for
collection fields. This aligns with the JavaScript GraphQL library
which uses readonly arrays, and enables future frozen datastructures.
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 8, 2026

Merging this PR will not alter performance

Summary

✅ 14 untouched benchmarks
🆕 4 new benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 test_pickle_large_query_encode N/A 110.8 ms N/A
🆕 test_pickle_large_query_roundtrip N/A 318.6 ms N/A
🆕 test_parse_large_query N/A 418 ms N/A
🆕 test_pickle_large_query_decode N/A 207.8 ms N/A

Comparing corydolphin:use-tuples-for-all-ast (83c2dd6) with main (283d002)

Open in CodSpeed

@Cito Cito merged commit be353e7 into graphql-python:main Jan 8, 2026
14 checks passed
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