graphql-framework-experiment
graphql-framework-experiment copied to clipboard
Faster cold start with V8 snapshots
Perceived Problem
- Cold start time is over half a second
- Combined with serverless platform, TTFB latency will easily exceed 1s in many cases
- And this is before any real app logic kicks in, db etc.
Ideas / Proposed Solution(s)
- Use V8 snapshots
- Have them include the schema built state
- Nexus build can automatically create them for the user
- Use lambda custom runtime to embed the v8 snapshot https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html
Links
- https://twitter.com/JedWatson/status/1242813629780484096
- https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html
Commmented on #295 also
I'm definitely interested in your progress with this -- custom runtimes with V8 Snapshots sounds like a huge win (but also sounds like something the AWS Lambda team easily can and probably should do on their own, considering end users are not charged for init time)