strawberry-graphql/strawberry-django

Slow startup when defining many filters

Aperta

#519 aperta il 18 apr 2024

 (5 commenti) (3 reazioni) (0 assegnatari)Python (152 fork)auto 404
enhancementhelp wantedquestion

Metriche repository

Star
 (496 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor