@@ -10,6 +10,9 @@ changes:
1010 - version: REPLACEME
1111 pr-url: https://github.com/nodejs/node/pull/46824
1212 description: Added support for "useSnapshot".
13+ - version: REPLACEME
14+ pr-url: https://github.com/nodejs/node/pull/48191
15+ description: Added support for "useCodeCache".
1316-->
1417
1518> Stability: 1 - Experimental: This feature is being designed and will change.
@@ -174,7 +177,8 @@ The configuration currently reads the following top-level fields:
174177 "main": "/path/to/bundled/script.js",
175178 "output": "/path/to/write/the/generated/blob.blob",
176179 "disableExperimentalSEAWarning": true, // Default: false
177- "useSnapshot": false // Default: false
180+ "useSnapshot": false, // Default: false
181+ "useCodeCache": true // Default: false
178182}
179183```
180184
@@ -213,6 +217,18 @@ and the main script can use the [`v8.startupSnapshot` API][] to adapt to
213217these constraints. See
214218[documentation about startup snapshot support in Node.js][].
215219
220+ ### V8 code cache support
221+
222+ When `useCodeCache` is set to `true` in the configuration, during the generation
223+ of the single executable preparation blob, Node.js will compile the `main`
224+ script to generate the V8 code cache. The generated code cache would be part of
225+ the preparation blob and get injected into the final executable. When the single
226+ executable application is launched, instead of compiling the `main` script from
227+ scratch, Node.js would use the code cache to speed up the compilation, then
228+ execute the script, which would improve the startup performance.
229+
230+ **Note:** `import()` does not work when `useCodeCache` is `true`.
231+
216232## Notes
217233
218234### `require(id)` in the injected module is not file based
0 commit comments