# Performance Four small programs, written idiomatically in each language ([`tests/compare`](../tests/compare), run by `scripts/compare.sh`; every toolchain is pinned by [`tests/compare/Containerfile`](../tests/compare/Containerfile)). Each prints the same number. **Instructions** are the stable signal where wall clock varies on a shared machine; wall clock is best of 5 runs. ## `lists`: a map/filter/fold pipeline over a million integers, ten times | language | wall | instructions | peak memory | executable (stripped) | |---|---:|---:|---:|---:| | Haskell (GHC) | 0.05 s | 0.22G | 3 MB | 956 KB | | **Louise** | **0.05 s** | **0.47G** | **6 MB** | **466 KB** | | Go | 0.08 s | 0.27G | 34 MB | 1.5 MB | | Rust | 0.09 s | 0.15G | 17 MB | 337 KB | | Java | 0.90 s | 12.49G | 449 MB | runtime | | Node | 1.36 s | 10.37G | 162 MB | runtime | | Python | 1.54 s | 10.46G | 130 MB | runtime | | Gleam (on node) | 19.96 s | 122.56G | 704 MB | runtime | ## `fib`: calls and integer arithmetic (naive Fibonacci of 35) | language | wall | instructions | peak memory | executable (stripped) | |---|---:|---:|---:|---:| | Rust | 0.04 s | 0.29G | 1 MB | 337 KB | | Haskell (GHC) | 0.07 s | 0.42G | 3 MB | 956 KB | | Go | 0.07 s | 0.43G | 2 MB | 1.5 MB | | Java | 0.10 s | 0.45G | 36 MB | runtime | | **Louise** | **0.12 s** | **0.95G** | **6 MB** | **459 KB** | | Node | 0.32 s | 1.90G | 55 MB | runtime | | Gleam (on node) | 0.35 s | 2.05G | 58 MB | runtime | | Python | 1.56 s | 15.81G | 8 MB | runtime | ## `trees`: build and walk binary trees (allocation) | language | wall | instructions | peak memory | executable (stripped) | |---|---:|---:|---:|---:| | Haskell (GHC) | 0.15 s | 0.99G | 7 MB | 957 KB | | Java | 0.26 s | 1.05G | 148 MB | runtime | | **Louise** | **0.30 s** | **2.34G** | **8 MB** | **468 KB** | | Node | 0.44 s | 2.62G | 85 MB | runtime | | Rust | 0.68 s | 5.69G | 5 MB | 337 KB | | Go | 0.79 s | 6.00G | 11 MB | 1.5 MB | | Python | 2.46 s | 22.82G | 12 MB | runtime | | Gleam (on node) | 5.22 s | 39.14G | 196 MB | runtime | ## `floats`: arithmetic in a loop, three million times | language | wall | instructions | peak memory | executable (stripped) | |---|---:|---:|---:|---:| | Rust | 0.00 s | 0.02G | 1 MB | 357 KB | | Go | 0.00 s | 0.02G | 2 MB | 1.5 MB | | Haskell (GHC) | 0.00 s | 0.02G | 4 MB | 2.3 MB | | **Louise** | **0.00 s** | **0.03G** | **6 MB** | **410 KB** | | Java | 0.10 s | 0.38G | 42 MB | runtime | | Node | 0.16 s | 0.44G | 58 MB | runtime | | Gleam (on node) | 0.19 s | 0.53G | 60 MB | runtime | | Python | 0.52 s | 4.99G | 8 MB | runtime | Before the unboxing milestone (#190) the same loop took 653M instructions and 83 ms: every `+` allocated a heap block. A release build of hello world is 387 KB: a static executable with the actor scheduler, the allocator and the runtime ([ADR 0042](adr/0042-smaller-release-binaries.md)). What the numbers say: - **Calls and arithmetic:** `Int`-heavy functions now run on unboxed machine integers (ADR 0045 Revision 2): a worker keeps raw `int64`s in registers and tags only at the boundary, bailing to the boxed path on overflow so promote-to-bigint semantics are exact. `fib`'s instructions fell by a third (1.40G → 0.95G): Louise is now about 3× Rust and 2.3× GHC on a call-heavy loop, and nearly 3× faster than Node. The remaining gap is per-call preemption and yield checks (#193) and devirtualising trait calls (#192) is next. - **Float arithmetic:** a float loop's arithmetic runs on raw doubles, allocating nothing: 31M instructions, about twice Rust's (15M) and 1.3–1.4× Go's and GHC's, and an order of magnitude fewer than Node or Java. Until #190 every `+` allocated a heap block (the same loop: 653M instructions, 83 ms). - **List pipelines:** the Core optimiser (#195–#200) fuses `range |> map |> filter |> fold` into one loop that allocates nothing per element — and now does so inside `if`/`match` arms too, which the benchmark's own pipeline had been missing (it built both intermediate lists: 2.66G instructions). Fused, the pipeline is 0.47G instructions (−82%) and 6 MB peak (−83%): Louise ties GHC's list fusion on wall clock and is ahead of Rust's collecting iterators, though Rust's unboxed `Vec` still leads on instructions (0.15G). `std/iter`'s lazy iterators fuse without rewrite rules (#199). - **Allocation-heavy code:** reference counting with in-place reuse (Perceus) is faster than Rust's `Box` with the system allocator and close to GHC's garbage collector, in a fraction of Node's memory — and with a fraction of the instructions of everything but Haskell. Measured in the pinned container ([`tests/compare/Containerfile`](../tests/compare/Containerfile)), on one machine: Intel Core Ultra 7 155H, with rustc 1.99, GHC, Go, OpenJDK, Node and Python from Fedora 44. The other languages are from 2026-10-15; the Louise rows are re-measured on 2026-10-19 (their instruction counts on the host — rootless containers cannot open perf events on this kernel — with the same binaries and the same user-space event). Instructions are user-space, counted once per program; wall clock is best of 5. Small programs show orders of magnitude, not a ranking.