isol8 0.10.1 → 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 +43 -12
- package/dist/cli.js +272 -113
- package/dist/index.js +231 -77
- package/dist/src/engine/docker.d.ts +3 -0
- package/dist/src/engine/docker.d.ts.map +1 -1
- package/dist/src/engine/pool.d.ts +48 -13
- package/dist/src/engine/pool.d.ts.map +1 -1
- package/dist/src/types.d.ts +17 -0
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
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); // ~
|
|
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 (
|
|
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 |
|
|
340
|
-
| Node.js |
|
|
341
|
-
| Bun |
|
|
342
|
-
| Deno |
|
|
343
|
-
| Bash |
|
|
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 |
|
|
352
|
-
| Node.js |
|
|
353
|
-
| Bun |
|
|
354
|
-
| Deno |
|
|
355
|
-
| Bash |
|
|
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
|
|