Benchmarked against Dyalog APL v20.0 and GNU APL v2.0
Benchmarked against Dyalog APL v20.0 and GNU APL v2.0
on Apple M5. Native ARM64 + WASM (headless Chrome) side-by-side.
Internal timing via ⎕AI (compute-only, no startup overhead). 40 iterations, 95% CI.
APL Run wins or ties 28 of 34 benchmarks vs Dyalog.
The AST viewer shows exactly which optimizations were applied to your code. Learn about execution badges →
| Benchmark | Expression | APL Run | WASM | Dyalog | GNU APL |
|---|---|---|---|---|---|
| Prime Sieve | |||||
| Primes N=2000 | (2=+⌿0=∘.\|⍨⍳2000)/⍳2000 | 1.9 ± 0.0 | 5.2 ± 1.4 | 5.6 ± 0.5 | 65.8 ± 2.6 |
| Primes N=4000 | (2=+⌿0=∘.\|⍨⍳4000)/⍳4000 | 7.4 ± 0.0 | 14.1 ± 2.0 | 18.1 ± 0.8 | — |
| Matrix Multiply | |||||
| MatMul 100×100 | M←100 100⍴⍳10000 ⋄ +/,M+.×M | 0.2 ± 0.0 | 0.9 ± 1.0 | 0.8 ± 0.2 | 5.1 ± 0.1 |
| MatMul 200×200 | M←200 200⍴⍳40000 ⋄ +/,M+.×M | 1.0 ± 0.0 | 2.0 ± 1.3 | 1.5 ± 0.2 | 40.6 ± 2.3 |
| MatMul 400×400 | M←400 400⍴⍳160000 ⋄ +/,M+.×M | 7.4 ± 0.0 | 11.3 ± 2.5 | 8.9 ± 0.6 | — |
| Reductions & Arithmetic | |||||
| Sum ⍳2M | +/⍳2000000` (★ fused to O(1)) | 0.0 ± 0.0 | 0.4 ± 0.7 | 0.5 ± 0.2 | 9.7 ± 0.7 |
| Sum ?2M⍴1000 | +/?2000000⍴1000` (materialized) | 8.7 ± 0.1 | 5.9 ± 1.5 | 10.5 ± 0.6 | 24.9 ± 2.2 |
| Arith chain 10M | +/(3×⍳10000000)+(-⍳10000000) | 9.5 ± 0.0 | 18.3 ± 4.5 | 11.1 ± 1.2 | 178.8 ± 3.9 |
| Recursive Dfns | |||||
| Collatz ⍳1K | +/c¨⍳1000` (recursive dfn) | 1.3 ± 0.1 | 1.9 ± 0.9 | 33.1 ± 0.9 | — |
| Collatz ⍳5K | +/c¨⍳5000` (recursive dfn) | 8.4 ± 0.5 | 9.4 ± 1.2 | 201.8 ± 1.4 | — |
| Fibonacci ⍳25 | +/f¨⍳25` (doubly-recursive dfn) | 6.6 ± 0.2 | 9.4 ± 1.2 | 316.8 ± 1.6 | — |
| Sort & Newton | |||||
| Sort Int 100K | v[⍋v]` (100K random ints) | 1.3 ± 0.1 | 2.1 ± 1.1 | 1.4 ± 0.2 | 25.4 ± 2.0 |
| Sort Float 1M | v[⍋v]` (1M random floats) | 15.4 ± 0.1 | 15.6 ± 2.4 | 15.8 ± 0.6 | — |
| Sort String 100K | M[⍋M;]` (100K×10 char matrix) | 13.9 ± 0.7 | 18.4 ± 1.9 | 17.1 ± 0.6 | — |
| Newton √100K | {⍵-((⍵*2)-N)÷2×⍵}⍣20⊢N | 2.5 ± 0.2 | 3.4 ± 1.8 | 3.9 ± 0.5 | — |
| Newton √1M | {⍵-((⍵*2)-N)÷2×⍵}⍣20⊢N | 21.5 ± 0.2 | 28.0 ± 6.4 | 23.3 ± 0.8 | — |
| LCS (Longest Common Substring) | |||||
| LCS N=80 | nested dfns, trains, ¨ | 3.0 ± 0.3 | 4.8 ± 1.5 | 6.2 ± 0.4 | — |
| FFT (Cooley-Tukey) | |||||
| FFT 1024 | recursive dfn, complex ×/+ | 2.0 ± 0.1 | 4.1 ± 1.5 | 3.4 ± 0.3 | — |
| FFT 4096 | recursive dfn, complex ×/+ | 7.6 ± 0.0 | 10.9 ± 2.0 | 12.8 ± 0.6 | — |
| Standard Primitives | |||||
| Transpose 3K×3K | ⍉M` (3000×3000 matrix) | 14.9 ± 1.7 | 21.5 ± 3.3 | 7.9 ± 0.9 | 62.8 ± 2.8 |
| Reverse 10M | ⌽v` (10M-element vector) | 4.1 ± 0.5 | 7.3 ± 2.8 | 3.3 ± 0.7 | 64.0 ± 3.6 |
| Membership 2M∊1M | a∊b` (2M in 1M) | 3.8 ± 0.1 | 6.1 ± 2.0 | 3.5 ± 0.4 | — |
| Rotate 10M | 100⌽v` (10M-element vector) | 4.0 ± 0.4 | 7.0 ± 2.5 | 2.6 ± 0.5 | 105.3 ± 9.1 |
| Erdős Primes | |||||
| Erdős ⍳2500 | nested dfns, prime test, ¨ | 3.8 ± 0.0 | 5.7 ± 1.3 | 6.3 ± 0.4 | — |
| Erdős ⍳5000 | nested dfns, prime test, ¨ | 8.1 ± 0.2 | 10.5 ± 1.7 | 12.9 ± 0.6 | — |
| Lucky Numbers | |||||
| Lucky N=1600 | recursive sieve, replicate, modulus | 1.1 ± 0.1 | 2.5 ± 1.3 | 1.2 ± 0.3 | — |
| Lucky N=3000 | recursive sieve, replicate, modulus | 1.7 ± 0.0 | 3.8 ± 1.6 | 1.8 ± 0.3 | — |
| LSWRC (Unique Substrings) | |||||
| LSWRC N=117 | tacit defs, trains, compose, ¨ | 0.3 ± 0.1 | 1.4 ± 1.4 | 0.3 ± 0.2 | — |
| LSWRC N=567 | tacit defs, trains, compose, ¨ | 2.4 ± 0.0 | 6.1 ± 1.6 | 7.0 ± 0.5 | — |
| Shannon Entropy | |||||
| Shannon N=1500 | Key (⌸), compose bind, tacit trains | 4.0 ± 0.2 | 8.7 ± 2.0 | 7.3 ± 0.3 | — |
| Munchausen Numbers | |||||
| Munchausen ⍳10K | tacit train, compose, ⍎¨⍕, *⍨ | 28.5 ± 0.4 | 36.6 ± 2.1 | 78.8 ± 6.4 | — |
| Jaccard Similarity | |||||
| Jaccard 300K | (≢A∩B)÷≢A∪B` (set ops, deal) | 3.2 ± 0.2 | 6.9 ± 0.7 | 7.0 ± 0.5 | — |
| Bell Triangle | |||||
| Bell N=200×10 | trains, scan, compose, ⍣N | 1.7 ± 0.1 | 3.0 ± 1.4 | 4.4 ± 1.1 | — |
| Multi-LCS | |||||
| Multi-LCS ×2000 | tacit train, 3 strings, ↑⌽∧\ | 9.9 ± 0.2 | 15.7 ± 2.6 | 9.6 ± 0.4 | — |
| Benchmark | APL Run | WASM | Dyalog | GNU APL |
|---|---|---|---|---|
| Primes N=2000 | 1.0× | 2.7× | 2.9× | 34.4× |
| Primes N=4000 | 1.0× | 1.9× | 2.4× | — |
| MatMul 100×100 | 1.0× | 4.2× | 3.4× | 23.0× |
| MatMul 200×200 | 1.0× | 2.1× | 1.6× | 42.7× |
| MatMul 400×400 | 1.0× | 1.5× | 1.2× | — |
| Sum ⍳2M | 1.0× | 3.8× | 4.7× | 97.0× |
| Sum ?2M⍴1000 | 1.5× | 1.0× | 1.8× | 4.2× |
| Arith chain 10M | 1.0× | 1.9× | 1.2× | 18.9× |
| Collatz ⍳1K | 1.0× | 1.5× | 25.9× | — |
| Collatz ⍳5K | 1.0× | 1.1× | 24.1× | — |
| Fibonacci ⍳25 | 1.0× | 1.4× | 47.7× | — |
| Sort Int 100K | 1.0× | 1.6× | 1.1× | 19.5× |
| Sort Float 1M | 1.0× | 1.0× | 1.0× | — |
| Sort String 100K | 1.0× | 1.3× | 1.2× | — |
| Newton √100K | 1.0× | 1.4× | 1.6× | — |
| Newton √1M | 1.0× | 1.3× | 1.1× | — |
| LCS N=80 | 1.0× | 1.6× | 2.1× | — |
| FFT 1024 | 1.0× | 2.0× | 1.7× | — |
| FFT 4096 | 1.0× | 1.4× | 1.7× | — |
| Transpose 3K×3K | 1.9× | 2.7× | 1.0× | 8.0× |
| Reverse 10M | 1.2× | 2.2× | 1.0× | 19.4× |
| Membership 2M∊1M | 1.1× | 1.7× | 1.0× | — |
| Rotate 10M | 1.5× | 2.7× | 1.0× | 40.1× |
| Erdős ⍳2500 | 1.0× | 1.5× | 1.7× | — |
| Erdős ⍳5000 | 1.0× | 1.3× | 1.6× | — |
| Lucky N=1600 | 1.0× | 2.2× | 1.1× | — |
| Lucky N=3000 | 1.0× | 2.2× | 1.1× | — |
| LSWRC N=117 | 1.0× | 5.1× | 1.2× | — |
| LSWRC N=567 | 1.0× | 2.6× | 3.0× | — |
| Shannon N=1500 | 1.0× | 2.2× | 1.8× | — |
| Munchausen ⍳10K | 1.0× | 1.3× | 2.8× | — |
| Jaccard 300K | 1.0× | 2.2× | 2.2× | — |
| Bell N=200×10 | 1.0× | 1.7× | 2.6× | — |
| Multi-LCS ×2000 | 1.0× | 1.6× | 1.0× | — |
Last benchmarked: 2026-07-22. APL Run native = ARM64 binary (apl_cli).
WASM = same Rust code compiled to WebAssembly, running in headless Chrome.
Single-core (no threading). SIMD enabled (native only).