botobag / artemis

GraphQL implementation for Go
Other
10 stars 0 forks source link

Add API to use jsoniter.Encoder to write ExecutionResult. #142

Closed zonr closed 5 years ago

zonr commented 5 years ago
2019-02-11 5 58 51

Our benchmarks (https://github.com/travelgateX/presenters-benchmark/) shows that it takes 30% of total execution time to encode the result to JSON and roughly one third of time spent in encoding/json.compact because we use encoding/json.Encoder to write the result. Switch to jsoniter.Encoder could eliminate the overheads. We need to investigate that whether the output would lose compaction.