mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-23 08:00:45 +00:00
e12186cef2
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>