⚡ Performance

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 →

Absolute Performance (msec, 95% CI)

Benchmark Expression APL Run WASM Dyalog GNU APL
Prime Sieve
Primes N=2000(2=+⌿0=∘.\|⍨⍳2000)/⍳20001.9 ± 0.05.2 ± 1.45.6 ± 0.565.8 ± 2.6
Primes N=4000(2=+⌿0=∘.\|⍨⍳4000)/⍳40007.4 ± 0.014.1 ± 2.018.1 ± 0.8
Matrix Multiply
MatMul 100×100M←100 100⍴⍳10000 ⋄ +/,M+.×M0.2 ± 0.00.9 ± 1.00.8 ± 0.25.1 ± 0.1
MatMul 200×200M←200 200⍴⍳40000 ⋄ +/,M+.×M1.0 ± 0.02.0 ± 1.31.5 ± 0.240.6 ± 2.3
MatMul 400×400M←400 400⍴⍳160000 ⋄ +/,M+.×M7.4 ± 0.011.3 ± 2.58.9 ± 0.6
Reductions & Arithmetic
Sum ⍳2M+/⍳2000000` (★ fused to O(1))0.0 ± 0.00.4 ± 0.70.5 ± 0.29.7 ± 0.7
Sum ?2M⍴1000+/?2000000⍴1000` (materialized)8.7 ± 0.15.9 ± 1.510.5 ± 0.624.9 ± 2.2
Arith chain 10M+/(3×⍳10000000)+(-⍳10000000)9.5 ± 0.018.3 ± 4.511.1 ± 1.2178.8 ± 3.9
Recursive Dfns
Collatz ⍳1K+/c¨⍳1000` (recursive dfn)1.3 ± 0.11.9 ± 0.933.1 ± 0.9
Collatz ⍳5K+/c¨⍳5000` (recursive dfn)8.4 ± 0.59.4 ± 1.2201.8 ± 1.4
Fibonacci ⍳25+/f¨⍳25` (doubly-recursive dfn)6.6 ± 0.29.4 ± 1.2316.8 ± 1.6
Sort & Newton
Sort Int 100Kv[⍋v]` (100K random ints)1.3 ± 0.12.1 ± 1.11.4 ± 0.225.4 ± 2.0
Sort Float 1Mv[⍋v]` (1M random floats)15.4 ± 0.115.6 ± 2.415.8 ± 0.6
Sort String 100KM[⍋M;]` (100K×10 char matrix)13.9 ± 0.718.4 ± 1.917.1 ± 0.6
Newton √100K{⍵-((⍵*2)-N)÷2×⍵}⍣20⊢N2.5 ± 0.23.4 ± 1.83.9 ± 0.5
Newton √1M{⍵-((⍵*2)-N)÷2×⍵}⍣20⊢N21.5 ± 0.228.0 ± 6.423.3 ± 0.8
LCS (Longest Common Substring)
LCS N=80nested dfns, trains, ¨3.0 ± 0.34.8 ± 1.56.2 ± 0.4
FFT (Cooley-Tukey)
FFT 1024recursive dfn, complex ×/+2.0 ± 0.14.1 ± 1.53.4 ± 0.3
FFT 4096recursive dfn, complex ×/+7.6 ± 0.010.9 ± 2.012.8 ± 0.6
Standard Primitives
Transpose 3K×3K⍉M` (3000×3000 matrix)14.9 ± 1.721.5 ± 3.37.9 ± 0.962.8 ± 2.8
Reverse 10M⌽v` (10M-element vector)4.1 ± 0.57.3 ± 2.83.3 ± 0.764.0 ± 3.6
Membership 2M∊1Ma∊b` (2M in 1M)3.8 ± 0.16.1 ± 2.03.5 ± 0.4
Rotate 10M100⌽v` (10M-element vector)4.0 ± 0.47.0 ± 2.52.6 ± 0.5105.3 ± 9.1
Erdős Primes
Erdős ⍳2500nested dfns, prime test, ¨3.8 ± 0.05.7 ± 1.36.3 ± 0.4
Erdős ⍳5000nested dfns, prime test, ¨8.1 ± 0.210.5 ± 1.712.9 ± 0.6
Lucky Numbers
Lucky N=1600recursive sieve, replicate, modulus1.1 ± 0.12.5 ± 1.31.2 ± 0.3
Lucky N=3000recursive sieve, replicate, modulus1.7 ± 0.03.8 ± 1.61.8 ± 0.3
LSWRC (Unique Substrings)
LSWRC N=117tacit defs, trains, compose, ¨0.3 ± 0.11.4 ± 1.40.3 ± 0.2
LSWRC N=567tacit defs, trains, compose, ¨2.4 ± 0.06.1 ± 1.67.0 ± 0.5
Shannon Entropy
Shannon N=1500Key (⌸), compose bind, tacit trains4.0 ± 0.28.7 ± 2.07.3 ± 0.3
Munchausen Numbers
Munchausen ⍳10Ktacit train, compose, ⍎¨⍕, *⍨28.5 ± 0.436.6 ± 2.178.8 ± 6.4
Jaccard Similarity
Jaccard 300K(≢A∩B)÷≢A∪B` (set ops, deal)3.2 ± 0.26.9 ± 0.77.0 ± 0.5
Bell Triangle
Bell N=200×10trains, scan, compose, ⍣N1.7 ± 0.13.0 ± 1.44.4 ± 1.1
Multi-LCS
Multi-LCS ×2000tacit train, 3 strings, ↑⌽∧\9.9 ± 0.215.7 ± 2.69.6 ± 0.4

Relative Performance (× slower than fastest)

Benchmark APL Run WASM Dyalog GNU APL
Primes N=20001.0×2.7×2.9×34.4×
Primes N=40001.0×1.9×2.4×
MatMul 100×1001.0×4.2×3.4×23.0×
MatMul 200×2001.0×2.1×1.6×42.7×
MatMul 400×4001.0×1.5×1.2×
Sum ⍳2M1.0×3.8×4.7×97.0×
Sum ?2M⍴10001.5×1.0×1.8×4.2×
Arith chain 10M1.0×1.9×1.2×18.9×
Collatz ⍳1K1.0×1.5×25.9×
Collatz ⍳5K1.0×1.1×24.1×
Fibonacci ⍳251.0×1.4×47.7×
Sort Int 100K1.0×1.6×1.1×19.5×
Sort Float 1M1.0×1.0×1.0×
Sort String 100K1.0×1.3×1.2×
Newton √100K1.0×1.4×1.6×
Newton √1M1.0×1.3×1.1×
LCS N=801.0×1.6×2.1×
FFT 10241.0×2.0×1.7×
FFT 40961.0×1.4×1.7×
Transpose 3K×3K1.9×2.7×1.0×8.0×
Reverse 10M1.2×2.2×1.0×19.4×
Membership 2M∊1M1.1×1.7×1.0×
Rotate 10M1.5×2.7×1.0×40.1×
Erdős ⍳25001.0×1.5×1.7×
Erdős ⍳50001.0×1.3×1.6×
Lucky N=16001.0×2.2×1.1×
Lucky N=30001.0×2.2×1.1×
LSWRC N=1171.0×5.1×1.2×
LSWRC N=5671.0×2.6×3.0×
Shannon N=15001.0×2.2×1.8×
Munchausen ⍳10K1.0×1.3×2.8×
Jaccard 300K1.0×2.2×2.2×
Bell N=200×101.0×1.7×2.6×
Multi-LCS ×20001.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).