Skip to content

Performance#37

Merged
ttbombadil merged 7 commits intodevfrom
performance
Mar 2, 2026
Merged

Performance#37
ttbombadil merged 7 commits intodevfrom
performance

Conversation

@ttbombadil
Copy link
Collaborator

Worker-Pool, Runner-Pool, Compression, Refactorings

ttbombadil and others added 7 commits March 2, 2026 13:33
- Add CompilationWorkerPool with configurable worker count (~50% of CPUs)
- Add Worker thread implementation for async compilation
- Wrap in PooledCompiler adapter for drop-in compatibility
- Integrate into compiler.routes.ts with no breaking changes
- All 882 tests pass (0 new failures)
- EstImated latency reduction: ~30% under concurrent load
…ptimization

- Configured perMessageDeflate with Z_BEST_SPEED (Level 1) and 256-byte threshold
- Optimized for 200+ concurrent classroom connections
- Added environment-based worker pool fallback (dev: direct compiler, prod: worker pool)
- Fixed ESM compatibility in compilation-worker-pool.ts

Bandwidth reduction: ~37% for typical simulation sessions
E2E tests: 3/3 passing (17.8s)

Addresses classroom scalability (Phase 0.2)
- Added simple-load-test.mjs for manual load testing (50/200 clients)
- Updated CLASSROOM_METRICS.json with Phase 0.2.5 results
- Fixed compilation-worker-pool.ts to fallback .js -> .ts for tsx compatibility
- Added @vitest-environment node directive to load test files
- Created PHASE_0.2.5_LOAD_TEST_REPORT.md with comprehensive analysis

Results:
- 200 concurrent clients: 100% success rate ✅
- WebSocket compression: Active (perMessageDeflate) ✅
- Worker Pool: Not testable in tsx (ESM @shared/* limitation), validated in Phase 0.1 ✅
- Compilation cache: ~99.5% latency reduction (10s → 50ms)

Phase 0.1 + 0.2 merged to performance branch, ready for Phase 0.3 approval
@ttbombadil ttbombadil changed the base branch from main to dev March 2, 2026 14:48
@ttbombadil ttbombadil merged commit e85fea2 into dev Mar 2, 2026
4 checks passed
@ttbombadil ttbombadil deleted the performance branch March 2, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant