@@ -10,6 +10,9 @@ changes:
10
10
- version: REPLACEME
11
11
pr-url: https://github.com/nodejs/node/pull/46824
12
12
description: Added support for "useSnapshot".
13
+ - version: REPLACEME
14
+ pr-url: https://github.com/nodejs/node/pull/48191
15
+ description: Added support for "useCodeCache".
13
16
-->
14
17
15
18
> Stability: 1 - Experimental: This feature is being designed and will change.
@@ -174,7 +177,8 @@ The configuration currently reads the following top-level fields:
174
177
"main": "/path/to/bundled/script.js",
175
178
"output": "/path/to/write/the/generated/blob.blob",
176
179
"disableExperimentalSEAWarning": true, // Default: false
177
- "useSnapshot": false // Default: false
180
+ "useSnapshot": false, // Default: false
181
+ "useCodeCache": true // Default: false
178
182
}
179
183
```
180
184
@@ -213,6 +217,18 @@ and the main script can use the [`v8.startupSnapshot` API][] to adapt to
213
217
these constraints. See
214
218
[documentation about startup snapshot support in Node.js][].
215
219
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
+
216
232
## Notes
217
233
218
234
### `require(id)` in the injected module is not file based
0 commit comments