v8-compile-cache

Require hook for automatic V8 compile cache persistence

  • 所有者: zertosh/v8-compile-cache
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

v8-compile-cache

Build Status

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:
$ npm install --save v8-compile-cache
  1. Then, in your entry module add:
require('v8-compile-cache');

Requiring v8-compile-cache in Node <5.7.0 is a noop – but you need at least Node 4.0.0 to support the ES2015 syntax used by v8-compile-cache.

Options

Set the environment variable DISABLE_V8_COMPILE_CACHE=1 to disable the cache.

Internals

The caches are stored in $TMP/v8-compile-cache/V8_VERSION, where there are .BLOB and .MAP files 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

主要指标

概览
名称与所有者zertosh/v8-compile-cache
主编程语言JavaScript
编程语言JavaScript (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2017-02-21 20:56:26
推送于2023-12-12 10:22:39
最后一次提交2023-08-14 14:38:32
发布数13
最新版本名称v2.4.0 (发布于 )
第一版名称v1.0.0 (发布于 2017-02-21 20:12:51)
用户参与
星数740
关注者数9
派生数41
提交数107
已启用问题?
问题数23
打开的问题数15
拉请求数11
打开的拉请求数7
关闭的拉请求数9
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?