aws / aws/aws-lambda-base-images

Node Compile Cache For Faster Startups

Open
#271 0 comments 5 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
777
Forks
118
PR merge metrics
No merged PRs in 30d

Description

Do AWS Lambdas use Node's new [compile cache](https://nodejs.org/api/module.html#module-compile-cache) (available from 22.1+) feature to speed up startups yet?

Specifically, setting `NODE_COMPILE_CACHE=path/to/cache` will use [V8's code caching](https://v8.dev/blog/code-caching-for-devs) to skip parsing and compiling files by caching the results to the disk. The cold start speed improvements should be theoretically **massive**.

---

[Netlify's CLI starts up "75-400ms" faster on average with it enabled](https://bsky.app/profile/philippeserhal.com/post/3lmsf6rkvic2a)

[It would be especially effective if enabled when running TS files with Node's built-in TS support](https://bsky.app/profile/joyeecheung.bsky.social/post/3lgjvcaqizk2c)

[ESLint's CLI startup time went from 200ms->130ms](https://github.com/eslint/eslint/pull/19012)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.