fast-graphql is an experimental GraphQL implementation with Golang. This repo focuses on improve GraphQL speed to a new level.
For now, we will try GraphQL JIT, Cache Optimize runtime, Raw-ASM Parser, and SIMD methods to optimize.
WARNING: this repo is under construction, not production-ready.
In a typical 0.2 KB GraphQL request test (1, 2), the performance comparison between fast-graphql and other GraphQL implementations is as follows:
When using the net/http library, fast-graphql takes up only 38% of the runtime time, with the rest of the overhead being net/http, I/O, Runtime GC, and so on.
This means that better performance can be achieved when using other HTTP libraries, such as fasthttp.
- Prepare.
- GraphQL Features.
- GraphQL Lexer & Parser. (✔️)
- A Minimal Demo with Query Operation. (✔️)
- GraphQL Features
- Frontend Optimize
- Arguments-Substitution. (✔️)
- Backend Optimize
- Strings Serialization Optimize. (✔️)
- Reflect Optimize
- Serialization/Deserialization Optimize (✔️)
- Request-Parser. (✔️)
- Replace encoding/json with result buffer. (✔️)
- Cache-Policy
- AST Cache. (✔️)
- Backend Cache. (✔️)
- GraphQL JIT
- ASM Parser Demo. (✔️)
- JIT Frontend Prototype. ()
- JIT Backend Prototype. (✔️)
- function call cause GC kill the progress issue. ()
- ASM & SIMD Optimize. ()
- GC & memory Optimize. ()
- Demo for Usage. ()
- Test & Testcase. ()
The basic backend logic of this repo is port from graphql-go, and the lexer & parser are inspired by Lua.