Skip to content

Benchmarks

All benchmarks on Apple M4, macOS 15, clang -O2. Honest numbers — run them yourself.

Compute

BenchmarkWynPython 3.12Go 1.22
fib(35)33ms~2,800ms~55ms
sort 10K ints1ms~3ms*~2ms*
sort 100K ints2ms~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

BenchmarkWyn v1.10Python 3.12
1M string append6ms~200ms
1M string concat108ms~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

ProgramSize
Hello world49KB
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

MetricValue
wyn build (hello world)411ms
wyn build --release1.1s
wyn run (dev, system cc + precompiled .a)477ms
wyn check (type check only)17ms

Concurrency

BenchmarkValue
Spawn overhead6μs/task
4x fib(35) parallel33ms (perfect 4x scaling)
4x fib(30) parallel6ms

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

BenchmarkValue
1M mixed string ops1.4MB peak RSS
Zero memory leaksVerified with ASan across all patterns
Zero buffer overflowsAll dynamic buffers, no fixed 64KB allocations
Zero concurrent crashes30/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.

MIT License