2.4.0 • Published 1 year ago

v8-compile-cache v2.4.0

Weekly downloads
15,345,320
License
MIT
Repository
github
Last release
1 year ago

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
  2. 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.

Cache directory is defined by environment variable V8_COMPILE_CACHE_CACHE_DIR or defaults to <os.tmpdir()>/v8-compile-cache-<V8_VERSION>.

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:

ModuleWithout CacheWith Cache
babel-core218ms185ms
yarn153ms113ms
yarn (bundled)228ms105ms

^ Includes the overhead of loading the cache itself.

Acknowledgements

@huyhpham/rn-linebit-bin@fz6m/eslint-plugin-sakinacomponennenttreact-native-bluetooth2killi8n-react-native-fast-imagepipihome@icanpm/api-masterwebpack-cli-lernavtex3@oneplanetcrowd/developersimpetus-lint-runner@almeidaa/ms@ianlucas/parcel-bundlerreact-native-template-rfbasedecode-and-encode-binary-textairscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxfdeneme323112@dqyfp/dl-cli-spa@effect-x/rett-cli@fundefund/funde_ck@ntt_app/react-native-custom-notification@hellcat/clireact-native-covid-sdkgql_din_mod@interaktiv/mibuilder@zycli/zyclimeetscheduler@jttechnic/interpreter@l1nyanm1ng/react-picture-viewer@electron.land/create-electron-app@electron.land/electron-scripts@ez-fe/ezuxp-linter-n@saeon/quick-form@iobroker-community-adapters/iobroker.device-watchermoosicmysql-formatreact-native-printer-brothers@belko.tech/belko-multi-wallet-sdk@newhorizon-tech/dd-npm-package-templatereact-native-shekhar-bridge-testcogoportutilsuncoded-connect@reversodev/oceanic-fleetwilscanner@khalitovadel/abstract-repository@oiti/documentoscopy-react-nativejs4cytoscape@respondea/cordova-plugin-v-inappbrowserreact-native-slider-kf@aora/aora@aora/typesinflint@infinitebrahmanuniverse/nolb-v8aorbplginexpand-react-bridge@everything-registry/sub-chunk-3038p149-tabletailwind-vector-effectsyncbackbasestemplewallet-eslint-pluginsvgo-clitest-carosello-campuswinx-form-winxwang_eslintweb-elements-iconswescheme-jsxams-cliws-root-changelogsage-toolsrn-tm-notifyrn-use-modal-hookrn-session-multiplier-demornttlockshikakashowgalleryservicectlserviceersamc2samc3samc4samc5sam-carouselsasoshoppyfit-toolresponsis-gantt-task-reactresponsive-react-apprfp-librn-circular-chartrn-adyen-dropinsupercluster-googlemaps-adapter-clonestemplates-buildersportscale-wifi-connect
2.4.0

1 year ago

2.3.0

4 years ago

2.2.0

4 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

8 years ago

1.0.0

8 years ago