99designs / 99designs/gqlgen

Improve: optimize graphql runtime

Đang mở
#3,372 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
performance
Ngôn ngữ chính
Go
Star
10.8k
Fork
1.3k
Merge trung bình
2 ngày 36 phút
Pull request đã merge (30 ngày)
26

Mô tả

### What happened?

The `transport.Post` implementation in the `Do` method has potential for optimization. Specifically, two areas could improve performance:
1. The `Do` method frequently converts `[]byte` to `string`, which incurs additional allocations.
2. `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`)
- Go version: `go1.23.2 darwin/amd64`

### Pull Request

https://github.com/99designs/gqlgen/pull/3373

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.