Video: https://skillsmatter.com/skillscasts/12178-code-caching-for-js-developers
Everybody knows that the fastest way to do something is to not do it at all, and V8 is no exception. After all, why parse and compile JavaScript that we’ve already parsed and compiled before?
But the caching behaviour of a JavaScript engine can be a bit of a mystery. What even gets cached, and why? Who decides when it is cached and where is it stored — and how many caches even are there? What if I use a service worker?
This talk will demystify code caching in V8, describing how code caching interacts with the disk, how in-memory code is re-used, how compiled scripts are serialized, and most importantly, how JS developers can benefit from these optimizations.