{"maintainers":[{"name":"zertosh","email":"zertosh@gmail.com"}],"dist-tags":{"latest":"1.1.0"},"author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"description":"Require hook for automatic V8 compile cache persistence","readme":"# v8-compile-cache\n\n[![Build Status](https://travis-ci.org/zertosh/v8-compile-cache.svg?branch=master)](https://travis-ci.org/zertosh/v8-compile-cache)\n\n`v8-compile-cache` attaches a `require` hook to use [V8's code cache](https://v8project.blogspot.com/2015/07/code-caching.html) to speed up instantiation time. The \"code cache\" is the work of parsing and compiling done by V8.\n\nThe ability to tap into V8 to produce/consume this cache was introduced in [Node v5.7.0](https://nodejs.org/en/blog/release/v5.7.0/).\n\n## Usage\n\n1. Add the dependency:\n\n  ```sh\n  $ npm install --save v8-compile-cache\n  ```\n\n2. Then, in your entry module add:\n\n  ```js\n  require('v8-compile-cache');\n  ```\n\n**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`.**\n\n## Options\n\nSet the environment variable `DISABLE_V8_COMPILE_CACHE=1` to disable the cache.\n\n## Internals\n\nThe 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.\n\n## Benchmarks\n\nSee https://github.com/zertosh/v8-compile-cache/tree/master/bench.\n\n**Load Times:**\n\n| Module           | Without Cache | With Cache |\n| ---------------- | -------------:| ----------:|\n| `babel-core`     | `218ms`       | `185ms`    |\n| `yarn`           | `153ms`       | `113ms`    |\n| `yarn` (bundled) | `228ms`       | `105ms`    |\n\n_^ Includes the overhead of loading the cache itself._\n\n## Acknowledgements\n\n* `FileSystemBlobStore` and `NativeCompileCache` are based on Atom's implementation of their v8 compile cache: \n  - https://github.com/atom/atom/blob/b0d7a8a/src/file-system-blob-store.js\n  - https://github.com/atom/atom/blob/b0d7a8a/src/native-compile-cache.js\n* `mkdirpSync` is based on:\n  - https://github.com/substack/node-mkdirp/blob/f2003bb/index.js#L55-L98\n","license":"MIT","versions":{"1.0.0":{"name":"v8-compile-cache","version":"1.0.0","description":"Require hook for automatic V8 compile cache persistence","main":"v8-compile-cache.js","scripts":{"bench":"bench/run.sh","lint":"eslint --max-warnings=0 .","test":"tap test/*-test.js"},"author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"files":["v8-compile-cache.js"],"license":"MIT","dependencies":{},"devDependencies":{"babel-core":"6.23.1","eslint":"^3.15.0","flow-parser":"0.38.0","rimraf":"^2.5.4","rxjs":"5.2.0","semver":"^5.3.0","tap":"^10.1.1","temp":"^0.8.3","yarn":"0.20.3"},"gitHead":"fd1806b1ab080be818509a4449e56f6610a391ba","_id":"v8-compile-cache@1.0.0","_shasum":"56c809189daa8289a7d049354f61ab9c347f1fc2","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"zertosh","email":"zertosh@gmail.com"},"dist":{"shasum":"56c809189daa8289a7d049354f61ab9c347f1fc2","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/v8-compile-cache/-/v8-compile-cache-1.0.0.tgz"},"maintainers":[{"name":"zertosh","email":"zertosh@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/v8-compile-cache-1.0.0.tgz_1487726028684_0.6439736553002149"},"directories":{}},"1.1.0":{"name":"v8-compile-cache","version":"1.1.0","description":"Require hook for automatic V8 compile cache persistence","main":"v8-compile-cache.js","scripts":{"bench":"bench/run.sh","lint":"eslint --max-warnings=0 .","test":"tap test/*-test.js"},"author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"files":["v8-compile-cache.js"],"license":"MIT","dependencies":{},"devDependencies":{"babel-core":"6.23.1","eslint":"^3.15.0","flow-parser":"0.38.0","rimraf":"^2.5.4","rxjs":"5.2.0","semver":"^5.3.0","tap":"^10.1.1","temp":"^0.8.3","yarn":"0.20.3"},"gitHead":"f8cfde535f527e0437304779ec45423fb27eca06","_id":"v8-compile-cache@1.1.0","_shasum":"1dc2a340fb8e5f800a32bcdbfb8c23cd747021b9","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.4","_npmUser":{"name":"zertosh","email":"zertosh@gmail.com"},"dist":{"shasum":"1dc2a340fb8e5f800a32bcdbfb8c23cd747021b9","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/v8-compile-cache/-/v8-compile-cache-1.1.0.tgz"},"maintainers":[{"name":"zertosh","email":"zertosh@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/v8-compile-cache-1.1.0.tgz_1490644883319_0.9767482061870396"},"directories":{}}},"name":"v8-compile-cache","time":{"modified":"2017-03-27T20:01:24.028Z","created":"2017-02-22T01:13:50.544Z","1.0.0":"2017-02-22T01:13:50.544Z","1.1.0":"2017-03-27T20:01:24.028Z"},"readmeFilename":"README.md"}