You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The transport.Post implementation in the Do method has potential for optimization. Specifically, two areas could improve performance:
The Do method frequently converts []byte to string, which incurs additional allocations.
graphql.RawParams could benefit from a sync.Pool to reduce allocations and reuse memory.
What did you expect?
Optimizing memory allocation in the Do method should lead to better overall performance for the gqlgen server, especially for high-throughput applications.
Minimal graphql.schema and models to reproduce
I tested using the gqlgen initial schema and an empty slice return for the Todos query, observing allocation patterns during benchmarking.
Versions
gqlgen version: v0.17.55 (via go run github.com/99designs/gqlgen version)
What happened?
The
transport.Post
implementation in theDo
method has potential for optimization. Specifically, two areas could improve performance:Do
method frequently converts[]byte
tostring
, which incurs additional allocations.graphql.RawParams
could benefit from async.Pool
to reduce allocations and reuse memory.What did you expect?
Optimizing memory allocation in the
Do
method should lead to better overall performance for the gqlgen server, especially for high-throughput applications.Minimal graphql.schema and models to reproduce
I tested using the gqlgen initial schema and an empty slice return for the
Todos
query, observing allocation patterns during benchmarking.Versions
v0.17.55
(viago run github.com/99designs/gqlgen version
)go1.23.2 darwin/amd64
Pull Request
#3373
The text was updated successfully, but these errors were encountered: