Files
Ruben Fiszel e12186cef2 feat: add lazy isolate pool for NativeTS prewarming
Add optional isolate pool to reduce V8 cold start overhead:

- Pool of dedicated threads, each with pre-created isolates
- Enabled via NATIVETS_ISOLATE_POOL=true environment variable
- Pool size = NUM_WORKERS + 1 (one spare ready while others in use)
- Fresh isolate per job (no state leakage between jobs)
- After job completes, isolate dropped and thread waits for next job

Implementation:
- Add crossbeam-channel for job dispatch to pool threads
- Pool initialized once at worker startup (in run_workers)
- Fallback to spawn_blocking when pool not enabled
- Add pool status/stats functions for monitoring

Tests:
- Add pool status reporting test
- Add sequential benchmark test (compare with/without pool)
- Add high concurrency stress test (20 parallel jobs)

To test:
  # Without pool (baseline)
  cargo test --features deno_core test_benchmark_sequential_jobs

  # With pool
  NATIVETS_ISOLATE_POOL=true cargo test --features deno_core test_benchmark_sequential_jobs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 11:27:45 +00:00
..
2025-10-23 20:18:08 +00:00
2025-10-23 20:18:08 +00:00
2026-01-09 07:23:45 +00:00