Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
V

v8-compile-cache

> 编程语言
Open source

Require hook for automatic V8 compile cache persistence

743 stars0 likes1 views
WebsiteGitHub

About

Require hook for automatic V8 compile cache persistence

v8-compile-cache

v8-compile-cache attaches a require hook to use V8's code cache to speed up instantiation time. The "code cache" is the work of parsing and compiling done by V8.

The ability to tap into V8 to produce/consume this cache was introduced in Node v5.7.0.

Usage

  1. Add the dependency:
bash
$ npm install --save v8-compile-cache
  1. Then, in your entry module add:
javascript
require('v8-compile-cache');

**Requiring v8-compile-cache in Node /v8-compile-cache-`.

Internals

Cache files are suffixed .BLOB and .MAP corresponding to the entry module that required v8-compile-cache. The cache is entry module specific because it is faster to load the entire code cache into memory at once, than it is to read it from disk on a file-by-file basis.

Benchmarks

See https://github.com/zertosh/v8-compile-cache/tree/master/bench.

Load Times:

Module Without Cache With Cache
babel-core 218ms 185ms
yarn 153ms 113ms
yarn (bundled) 228ms 105ms

^ Includes the overhead of loading the cache itself.

Acknowledgements

  • FileSystemBlobStore and NativeCompileCache are based on Atom's implementation of their v8 compile cache:
    • https://github.com/atom/atom/blob/b0d7a8a/src/file-system-blob-store.js
    • https://github.com/atom/atom/blob/b0d7a8a/src/native-compile-cache.js
  • mkdirpSync is based on:
    • https://github.com/substack/node-mkdirp/blob/f2003bb/index.js#L55-L98

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言