graphql-framework-experiment icon indicating copy to clipboard operation
graphql-framework-experiment copied to clipboard

Faster cold start with V8 snapshots

Open jasonkuhrt opened this issue 5 years ago • 1 comments

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

jasonkuhrt avatar Mar 26 '20 13:03 jasonkuhrt

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)

russell-dot-js avatar Jul 30 '20 21:07 russell-dot-js