Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # v8-compile-cache
  2. [![Build Status](https://travis-ci.org/zertosh/v8-compile-cache.svg?branch=master)](https://travis-ci.org/zertosh/v8-compile-cache)
  3. `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.
  4. The 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/).
  5. ## Usage
  6. 1. Add the dependency:
  7. ```sh
  8. $ npm install --save v8-compile-cache
  9. ```
  10. 2. Then, in your entry module add:
  11. ```js
  12. require('v8-compile-cache');
  13. ```
  14. **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`.**
  15. ## Options
  16. Set the environment variable `DISABLE_V8_COMPILE_CACHE=1` to disable the cache.
  17. Cache directory is defined by environment variable `V8_COMPILE_CACHE_CACHE_DIR` or defaults to `<os.tmpdir()>/v8-compile-cache-<V8_VERSION>`.
  18. ## Internals
  19. 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.
  20. ## Benchmarks
  21. See https://github.com/zertosh/v8-compile-cache/tree/master/bench.
  22. **Load Times:**
  23. | Module | Without Cache | With Cache |
  24. | ---------------- | -------------:| ----------:|
  25. | `babel-core` | `218ms` | `185ms` |
  26. | `yarn` | `153ms` | `113ms` |
  27. | `yarn` (bundled) | `228ms` | `105ms` |
  28. _^ Includes the overhead of loading the cache itself._
  29. ## Acknowledgements
  30. * `FileSystemBlobStore` and `NativeCompileCache` are based on Atom's implementation of their v8 compile cache:
  31. - https://github.com/atom/atom/blob/b0d7a8a/src/file-system-blob-store.js
  32. - https://github.com/atom/atom/blob/b0d7a8a/src/native-compile-cache.js
  33. * `mkdirpSync` is based on:
  34. - https://github.com/substack/node-mkdirp/blob/f2003bb/index.js#L55-L98