Wyn Benchmarks
March 2026 — Updated with honest numbers
All benchmarks run on Apple M4, wyn build (clang -O2). Run them yourself:
cd wyn
./wyn build tests/benchmarks/bench_suite.wyn && ./tests/benchmarks/bench_suite
./wyn build tests/benchmarks/spawn_benchmark.wyn && ./tests/benchmarks/spawn_benchmarkCPU: Fibonacci(35)
| Backend | Time |
|---|---|
wyn build (clang -O2) | ~120ms |
wyn run (TCC) | ~32ms |
Wyn emits C and compiles with the system C compiler. CPU-bound performance is determined by the C compiler's optimizer, not Wyn.
Concurrency
| Metric | Value |
|---|---|
| Sequential spawn+await (1K) | ~20 μs/op |
| Concurrent batch (100 + await_all) | ~15 μs/op |
| Max concurrent spawns | ~5-10K |
| Throughput via batching (10×1K) | ~10K/s |
Limitations
Each spawn allocates an 8MB virtual stack via mmap. Only ~4-8KB of physical memory is used for simple tasks, but the virtual address space limits concurrent spawns to ~5-10K on macOS. Higher concurrency requires smaller stacks (WYN_CORO_STACK=262144).
The pool allocator recycles destroyed coroutine memory via MAP_FIXED remap, making sequential spawn+await patterns efficient.
Build Speed
| Command | Time |
|---|---|
wyn build (clang) | ~1.1s |
wyn run (TCC) | ~1.9s |
Binary Size
A typical Wyn program compiles to ~50KB (statically linked runtime).
What We Don't Benchmark
We don't compare against Go, Rust, or Python because:
- Wyn's runtime is much younger — comparisons would be misleading
- CPU-bound code performance depends on the C compiler, not Wyn
- Concurrency overhead (~20μs/spawn) is adequate for real workloads but not competitive with Go (~1μs/goroutine)
When Wyn's runtime matures, we'll publish honest cross-language comparisons with reproducible methodology.