strawberry-graphql/strawberry-django

Slow startup when defining many filters

Open

#519 opened on Apr 18, 2024

View on GitHub
 (5 comments) (3 reactions) (0 assignees)Python (152 forks)auto 404
enhancementhelp wantedquestion

Repository metrics

Stars
 (496 stars)
PR merge metrics
 (PR metrics pending)

Description

Startup time for the app increases linearly as more filters and annotated types are added.

Describe the Bug

We have converted NetBox from graphene to Strawberry - one things we noticed is a large jump in startup times, tracing this down it was from Strawberry processing all the filters and annotated types (we have a lot defined). When using graphene there was no noticeable delay in startup time.

timing to create the schmea without the filterset annotations: 219.61 ms timing with the annotations: 4568.14 ms

The startup delay is fairly linear as you add more and more filter fields. Unfortunately it is difficult to provide an example project as it is only noticeable when you have a large number defined.

Contributor guide