Benchmarks
All benchmarks on Apple M4, macOS 15, clang -O2. Honest numbers — run them yourself.
Compute
| Benchmark | Wyn | Python 3.12 | Go 1.22 |
|---|---|---|---|
| fib(35) | 33ms | ~2,800ms | ~55ms |
| sort 10K ints | 1ms | ~3ms* | ~2ms* |
| sort 100K ints | 2ms | ~30ms* | ~15ms* |
* Python/Go use optimized C sort internally. Wyn uses C's qsort under the hood.
Wyn compiles to C — compute-heavy code runs at near-native speed. fib(35) is 85x faster than Python and within 2x of Go.
Strings
| Benchmark | Wyn v1.10 | Python 3.12 |
|---|---|---|
| 1M string append | 6ms | ~200ms |
| 1M string concat | 108ms | ~150ms |
1M .len() | 1ms (O(1) cache) | ~1ms |
100K method chain (.upper().trim()) | 8ms | ~50ms |
Wyn uses reference-counted strings with a length cache in the RC header. String append is O(1) amortized via capacity tracking and in-place mutation when refcount is 1.
Binary Size
| Program | Size |
|---|---|
| Hello world | 49KB |
| REST API server | ~75KB |
| GUI app | ~100KB |
Binaries include the full Wyn runtime (networking, file I/O, concurrency, ARC). No external runtime needed. Dead code stripping removes unused functions.
Compilation
| Metric | Value |
|---|---|
wyn build (hello world) | 411ms |
wyn build --release | 1.1s |
wyn run (dev, system cc + precompiled .a) | 477ms |
wyn check (type check only) | 17ms |
Concurrency
| Benchmark | Value |
|---|---|
| Spawn overhead | 6μs/task |
| 4x fib(35) parallel | 33ms (perfect 4x scaling) |
| 4x fib(30) parallel | 6ms |
Wyn uses a thread pool with one OS thread per CPU core. spawn queues work, await retrieves results. Thread-safe reference counting with atomic operations.
Memory
| Benchmark | Value |
|---|---|
| 1M mixed string ops | 1.4MB peak RSS |
| Zero memory leaks | Verified with ASan across all patterns |
| Zero buffer overflows | All dynamic buffers, no fixed 64KB allocations |
| Zero concurrent crashes | 30/30 runs correct under 4-thread stress |
Wyn uses Automatic Reference Counting (ARC) with scope-based cleanup. Strings, arrays, and HashMaps are freed deterministically at block exit.