Performance comparison between pydantic-resolve GraphQL and Strawberry GraphQL.
# Install dependencies
pip install strawberry-graphql[fastapi] matplotlib jinja2
# Run full benchmark
python benchmark/run_benchmark.py
# Run quick test (10 iterations)
python benchmark/run_benchmark.py --quickbenchmark/results/benchmark_report.html- Interactive HTML reportbenchmark/results/charts/*.png- Comparison charts
| Scenario | Description |
|---|---|
| simple_* | Single table queries |
| one_to_one | Task -> Owner relationship |
| one_to_many | Team -> Sprints/Users |
| nested_2_layers | Team -> Sprints -> Stories |
| nested_3_layers | Team -> Sprints -> Stories -> Tasks |
| nested_4_layers | Deep nesting with owners |
| concurrent_* | Parallel request handling |
- Response Time: Mean, Median, P95, P99 (ms)
- Memory Usage: Peak memory (MB)
- Throughput: Requests/second (concurrent tests)
- Uses
GraphQLHandlerfrompydantic_resolve.graphql - DataLoader via
aiodataloader - Entity-First architecture
- Uses
strawberry.Schemawithstrawberry.dataloader - FastAPI integration via
strawberry.fastapi.GraphQLRouter - Field-level resolvers