You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: add createNodeV8Runtime wrapper, remove @secure-exec/v8 from public API
createNodeV8Runtime() in @secure-exec/node bakes in bridge code and
warm pool defaults (pool of 3, 128MB heap). Callers no longer need to
import @secure-exec/v8 directly. Updated benchmarks, docs, and internal
refs to use the new wrapper.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@@ -132,7 +132,7 @@ Choose based on your isolation requirements. The shared topology is the most mem
132
132
133
133
```ts
134
134
// This process allows up to 5 concurrent sessions
135
-
const process =awaitcreateV8Runtime({ maxSessions: 5 });
135
+
const process =awaitcreateNodeV8Runtime({ maxSessions: 5 });
136
136
137
137
// Both runtimes share the 5-session budget
138
138
const rt1 =newNodeRuntime({
@@ -157,7 +157,7 @@ When a V8 process crashes (OOM, segfault, panic):
157
157
3.**New sessions cannot be created on the crashed process.** Create a new `V8Runtime` to recover.
158
158
159
159
```ts
160
-
const process =awaitcreateV8Runtime();
160
+
const process =awaitcreateNodeV8Runtime();
161
161
const factory =createNodeRuntimeDriverFactory({ v8Runtime: process });
162
162
163
163
const rt =newNodeRuntime({
@@ -171,14 +171,14 @@ const result = await rt.exec("const a = []; while(true) a.push(new Array(1e6))")
171
171
// Host process is still alive
172
172
```
173
173
174
-
Runtimes using the default shared process share crash fate — if the global process dies, all runtimes are affected. Use explicit `createV8Runtime()` handles to control which runtimes share a crash domain.
174
+
Runtimes using the default shared process share crash fate — if the global process dies, all runtimes are affected. Use explicit `createNodeV8Runtime()` handles to control which runtimes share a crash domain.
175
175
176
176
## Warm pool
177
177
178
178
Cold-starting a new session costs ~6ms (thread spawn + isolate creation from snapshot). The warm pool eliminates this by pre-creating sessions with isolates already initialized.
179
179
180
180
```ts
181
-
const process =awaitcreateV8Runtime({
181
+
const process =awaitcreateNodeV8Runtime({
182
182
warmupBridgeCode: bridgeCode,
183
183
warmPoolSize: 3, // default: 3 when bridgeCode provided, 0 otherwise
184
184
defaultWarmHeapLimitMb: 128,
@@ -199,7 +199,7 @@ Set `warmPoolSize: 0` to disable the pool entirely (falls back to the cold path
199
199
The caller owns the `V8Runtime` handle and is responsible for disposing it when done.
0 commit comments