isol8 0.10.0 → 0.10.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -183,11 +183,42 @@ const result = await isol8.execute({
183
183
 
184
184
  console.log(result.stdout); // "Hello from isol8!"
185
185
  console.log(result.exitCode); // 0
186
- console.log(result.durationMs); // ~38-69ms (warm pool)
186
+ console.log(result.durationMs); // ~120-140ms (warm pool)
187
187
 
188
188
  await isol8.stop();
189
189
  ```
190
190
 
191
+ ### Pool Strategy
192
+
193
+ isol8 supports two pool strategies for container reuse:
194
+
195
+ ```typescript
196
+ // Fast mode (default) - best performance
197
+ // Uses dual-pool system: clean pool + dirty pool
198
+ // Instant acquire from clean pool, immediate cleanup on acquire if needed
199
+ // Background cleanup runs every 5 seconds
200
+ const fastEngine = new DockerIsol8({
201
+ network: "none",
202
+ poolStrategy: "fast",
203
+ poolSize: { clean: 2, dirty: 2 }, // 2 ready, 2 being cleaned
204
+ });
205
+
206
+ // Secure mode - cleanup in acquire
207
+ // Slower but ensures container is always clean before use
208
+ const secureEngine = new DockerIsol8({
209
+ network: "none",
210
+ poolStrategy: "secure",
211
+ poolSize: 2, // 2 warm containers
212
+ });
213
+ ```
214
+
215
+ **Fast mode details:**
216
+ - Maintains two pools: `clean` (ready to use) and `dirty` (need cleanup)
217
+ - `acquire()` returns instantly from clean pool if available
218
+ - If clean pool is empty but dirty has containers, tries immediate cleanup
219
+ - Background cleanup runs every 5 seconds to process dirty containers
220
+ - Best performance with minimal memory overhead
221
+
191
222
  ### Persistent Sessions
192
223
 
193
224
  ```typescript
@@ -328,7 +359,7 @@ Full schema: [`schema/isol8.config.schema.json`](./schema/isol8.config.schema.js
328
359
 
329
360
  ## Benchmarks
330
361
 
331
- Execution latency for a "hello world" script per runtime. Measured on Apple Silicon (Docker Desktop), averaged across multiple runs. Results will vary by machine.
362
+ Execution latency for a "hello world" script per runtime. Measured on Apple Silicon (OrbStack), averaged across multiple runs. Results will vary by machine.
332
363
 
333
364
  ### Cold Start (fresh engine per run)
334
365
 
@@ -336,11 +367,11 @@ Each run creates a new `DockerIsol8` instance, executes, and tears down.
336
367
 
337
368
  | Runtime | Min | Median | Max | Avg |
338
369
  |---------|-----|--------|-----|-----|
339
- | Python | 111ms | 120ms | 188ms | 140ms |
340
- | Node.js | 114ms | 126ms | 178ms | 130ms |
341
- | Bun | 104ms | 121ms | 196ms | 139ms |
342
- | Deno | 112ms | 122ms | 199ms | 139ms |
343
- | Bash | 104ms | 114ms | 152ms | 121ms |
370
+ | Python | 220ms | 280ms | 350ms | 280ms |
371
+ | Node.js | 200ms | 250ms | 320ms | 260ms |
372
+ | Bun | 180ms | 230ms | 300ms | 230ms |
373
+ | Deno | 210ms | 270ms | 340ms | 270ms |
374
+ | Bash | 180ms | 220ms | 280ms | 220ms |
344
375
 
345
376
  ### Warm Pool (reused engine)
346
377
 
@@ -348,11 +379,11 @@ A single `DockerIsol8` instance reused across 5 runs. The first run is cold (poo
348
379
 
349
380
  | Runtime | Cold | Warm Avg | Warm Min | Speedup |
350
381
  |---------|------|----------|----------|---------|
351
- | Python | 198ms | 56ms | 49ms | 4.1x |
352
- | Node.js | 145ms | 69ms | 60ms | 2.4x |
353
- | Bun | 152ms | 51ms | 45ms | 3.4x |
354
- | Deno | 128ms | 62ms | 54ms | 2.4x |
355
- | Bash | 124ms | 43ms | 38ms | 3.3x |
382
+ | Python | 300ms | 160ms | 130ms | 2.3x |
383
+ | Node.js | 280ms | 170ms | 140ms | 2.0x |
384
+ | Bun | 250ms | 155ms | 130ms | 1.9x |
385
+ | Deno | 270ms | 160ms | 140ms | 1.9x |
386
+ | Bash | 230ms | 145ms | 125ms | 1.8x |
356
387
 
357
388
  ### Execution Phase Breakdown
358
389