Skip to content

Conversation

@patrick91
Copy link
Member

Summary

Test graphql-core PR graphql-python/graphql-core#249 which introduces significant performance improvements using msgspec.Struct for AST nodes.

The PR claims:

  • 5.3x faster parsing (81ms → 15.4ms)
  • 13x faster serialization with msgpack
  • 4.7x faster deserialization

This PR temporarily uses the msgspec-performance branch from that PR to run our benchmarks and see the actual impact on Strawberry.

Test plan

  • CI benchmarks will run with the new graphql-core version
  • Compare CodSpeed results against main branch

Test graphql-core PR #249 which introduces significant performance
improvements using msgspec.Struct for AST nodes. The PR claims:
- 5.3x faster parsing
- 13x faster serialization with msgpack
- 4.7x faster deserialization

See: graphql-python/graphql-core#249
@botberry
Copy link
Member

botberry commented Jan 5, 2026

Hi, thanks for contributing to Strawberry 🍓!

We noticed that this PR is missing a RELEASE.md file. We use that to automatically do releases here on GitHub and, most importantly, to PyPI!

So as soon as this PR is merged, a release will be made 🚀.

Here's an example of RELEASE.md:

Release type: patch

Description of the changes, ideally with some examples, if adding a new feature.

Release type can be one of patch, minor or major. We use semver, so make sure to pick the appropriate type. If in doubt feel free to ask :)

Here's the tweet text:

🆕 Release (next) is out! Thanks to @patrick91 for the PR 👏

Get it here 👉 https://strawberry.rocks/release/(next)

@patrick91 patrick91 marked this pull request as draft January 5, 2026 11:55
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 5, 2026

Greptile Summary

This PR temporarily switches the graphql-core dependency from the stable PyPI version to an experimental git branch (msgspec-performance) to benchmark performance improvements claimed in graphql-python/graphql-core#249.

Key Changes:

  • Replaces graphql-core>=3.2.0,<3.4.0 with direct git reference to corydolphin/graphql-core@msgspec-performance
  • Enables CI benchmarks (CodSpeed) to measure the actual impact of msgspec.Struct-based AST nodes on Strawberry's performance
  • Expected improvements: 5.3x faster parsing, 13x faster msgpack serialization, 4.7x faster deserialization

Important Notes:

  • This change is intentionally temporary and should NOT be merged to main permanently
  • The git dependency will break normal package installation and distribution until reverted
  • Once benchmarks are collected, this should be reverted or the branch should be closed without merging

Confidence Score: 4/5

  • This PR is safe for benchmarking purposes but must not be merged to main in its current state
  • The change is minimal (single line) and appropriate for its stated purpose of benchmarking. However, using a git dependency instead of a PyPI package is not production-ready. Score is 4 instead of 5 because this dependency change would break package distribution if accidentally merged to main
  • The pyproject.toml git dependency must be reverted before any merge to main

Important Files Changed

Filename Overview
pyproject.toml Temporarily replaces graphql-core with experimental msgspec branch for benchmarking performance improvements

Sequence Diagram

sequenceDiagram
    participant PR as Pull Request
    participant CI as GitHub Actions
    participant Poetry as Poetry Install
    participant GC as graphql-core (msgspec branch)
    participant Tests as Benchmark Tests
    participant CS as CodSpeed

    PR->>CI: Push triggers workflow
    CI->>Poetry: Install dependencies
    Poetry->>GC: Install from git+https://github.com/corydolphin/graphql-core.git@msgspec-performance
    GC-->>Poetry: msgspec-based AST nodes
    Poetry-->>CI: Dependencies ready
    CI->>Tests: Run pytest tests/benchmarks --codspeed
    Tests->>GC: Parse GraphQL queries (5.3x faster)
    Tests->>GC: Serialize/deserialize AST (13x/4.7x faster)
    Tests-->>CS: Performance metrics
    CS-->>CI: Benchmark results vs main branch
    CI-->>PR: CodSpeed report with performance comparison
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

requires-python = ">=3.10,<4.0"
dependencies = [
"graphql-core>=3.2.0,<3.4.0",
"graphql-core @ git+https://github.com/corydolphin/graphql-core.git@msgspec-performance",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Ensure this git dependency is reverted before any production release - it's intended only for temporary benchmarking of the msgspec performance improvements.

Prompt To Fix With AI
This is a comment left during a code review.
Path: pyproject.toml
Line: 18:18

Comment:
**style:** Ensure this git dependency is reverted before any production release - it's intended only for temporary benchmarking of the msgspec performance improvements.

How can I resolve this? If you propose a fix, please make it concise.

@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.23%. Comparing base (4d2881b) to head (6c0670e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4086   +/-   ##
=======================================
  Coverage   94.22%   94.23%           
=======================================
  Files         540      540           
  Lines       35499    35499           
  Branches     1876     1876           
=======================================
+ Hits        33449    33451    +2     
+ Misses       1739     1737    -2     
  Partials      311      311           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 5, 2026

CodSpeed Performance Report

Merging #4086 will not alter performance

Comparing benchmark-graphql-core-msgspec (6c0670e) with main (4d2881b)

Summary

✅ 28 untouched

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.

3 participants