Introducing bytecode caching for Vercel Functions


Vercel has released an experimental feature to reduce the startup latency of large applications by up to 27%. To accelerate 'cold starts', the software engineering team developed a caching step to store JavaScript bytecode when a file is initially executed and reuse it in subsequent runs, eliminating the need to compile the code each time. This bytecode caching has been tested on three Next.js applications and has been found to continue to improve performance as the application size increases. The novel system, which developers can opt-in to by adding an Environment Variable, merges all bytecode chunks and optimises the cache with repeated use. The bytecode caching will require Node.js 20 and a framework that compiles to CommonJS.

read full post