⚡ 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. Internal timing via ⎕AI (compute-only, no startup overhead). 40 iterations, 95% CI.

APL Run wins or ties 26 of 30 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 Dyalog GNU APL
Prime Sieve
Primes N=2000(2=+⌿0=∘.\|⍨⍳2000)/⍳20001.8 ± 0.05.3 ± 0.965.6 ± 0.7
Primes N=4000(2=+⌿0=∘.\|⍨⍳4000)/⍳40007.4 ± 0.018.1 ± 1.0
Matrix Multiply
MatMul 100×100M←100 100⍴⍳10000 ⋄ +/,M+.×M0.2 ± 0.00.5 ± 0.25.6 ± 0.6
MatMul 200×200M←200 200⍴⍳40000 ⋄ +/,M+.×M0.9 ± 0.01.7 ± 0.339.1 ± 0.2
MatMul 400×400M←400 400⍴⍳160000 ⋄ +/,M+.×M7.4 ± 0.09.3 ± 0.5
Reductions & Arithmetic
Sum ⍳2M+/⍳2000000` (★ fused to O(1))0.0 ± 0.00.6 ± 0.610.0 ± 1.4
Sum ?2M⍴1000+/?2000000⍴1000` (materialized)8.7 ± 0.110.9 ± 0.532.5 ± 1.4
Arith chain 10M+/(3×⍳10000000)+(-⍳10000000)9.4 ± 0.111.2 ± 0.8185.4 ± 3.2
Recursive Dfns
Collatz ⍳1K+/c¨⍳1000` (recursive dfn)1.3 ± 0.038.4 ± 1.9
Collatz ⍳5K+/c¨⍳5000` (recursive dfn)8.5 ± 0.4216.7 ± 2.6
Fibonacci ⍳25+/f¨⍳25` (doubly-recursive dfn)7.1 ± 0.5324.6 ± 4.1
Sort & Newton
Sort Int 100Kv[⍋v]` (100K random ints)1.3 ± 0.11.9 ± 0.324.6 ± 0.3
Sort Float 1Mv[⍋v]` (1M random floats)16.0 ± 0.217.7 ± 1.3
Sort String 100KM[⍋M;]` (100K×10 char matrix)15.3 ± 1.618.4 ± 1.3
Newton √100K{⍵-((⍵*2)-N)÷2×⍵}⍣20⊢N2.4 ± 0.24.7 ± 0.7
Newton √1M{⍵-((⍵*2)-N)÷2×⍵}⍣20⊢N22.7 ± 0.523.9 ± 1.1
LCS (Longest Common Substring)
LCS N=80nested dfns, trains, ¨3.4 ± 0.47.3 ± 1.2
FFT (Cooley-Tukey)
FFT 1024recursive dfn, complex ×/+2.1 ± 0.13.8 ± 0.3
FFT 4096recursive dfn, complex ×/+8.0 ± 0.213.8 ± 0.8
Standard Primitives
Transpose 3K×3K⍉M` (3000×3000 matrix)17.2 ± 1.38.6 ± 1.267.3 ± 3.5
Reverse 10M⌽v` (10M-element vector)5.8 ± 0.43.5 ± 0.966.0 ± 1.7
Membership 2M∊1Ma∊b` (2M in 1M)3.9 ± 0.13.8 ± 0.5
Rotate 10M100⌽v` (10M-element vector)4.5 ± 0.43.2 ± 0.867.7 ± 2.0
Erdős Primes
Erdős ⍳2500nested dfns, prime test, ¨3.7 ± 0.06.8 ± 0.6
Erdős ⍳5000nested dfns, prime test, ¨8.0 ± 0.212.6 ± 0.7
Lucky Numbers
Lucky N=1600recursive sieve, replicate, modulus1.3 ± 0.40.8 ± 0.3
Lucky N=3000recursive sieve, replicate, modulus1.8 ± 0.02.1 ± 0.4
LSWRC (Unique Substrings)
LSWRC N=117tacit defs, trains, compose, ¨0.2 ± 0.00.4 ± 0.2
LSWRC N=567tacit defs, trains, compose, ¨2.5 ± 0.17.6 ± 0.8
Shannon Entropy
Shannon N=1500Key (⌸), compose bind, tacit trains3.6 ± 0.17.5 ± 0.5

Relative Performance (× slower than fastest)

Benchmark APL Run Dyalog GNU APL
Primes N=20001.0×2.9×35.6×
Primes N=40001.0×2.5×
MatMul 100×1001.0×2.4×27.1×
MatMul 200×2001.0×1.8×41.6×
MatMul 400×4001.0×1.3×
Sum ⍳2M1.0×6.0×99.7×
Sum ?2M⍴10001.0×1.3×3.7×
Arith chain 10M1.0×1.2×19.8×
Collatz ⍳1K1.0×29.2×
Collatz ⍳5K1.0×25.5×
Fibonacci ⍳251.0×45.6×
Sort Int 100K1.0×1.5×18.6×
Sort Float 1M1.0×1.1×
Sort String 100K1.0×1.2×
Newton √100K1.0×2.0×
Newton √1M1.0×1.1×
LCS N=801.0×2.1×
FFT 10241.0×1.8×
FFT 40961.0×1.7×
Transpose 3K×3K2.0×1.0×7.8×
Reverse 10M1.7×1.0×18.9×
Membership 2M∊1M1.0×1.0×
Rotate 10M1.4×1.0×20.8×
Erdős ⍳25001.0×1.8×
Erdős ⍳50001.0×1.6×
Lucky N=16001.7×1.0×
Lucky N=30001.0×1.2×
LSWRC N=1171.0×1.7×
LSWRC N=5671.0×3.1×
Shannon N=15001.0×2.1×

Last benchmarked: 2026-07-18. APL Run is single-core (no threading). SIMD enabled. Recursive dfn benchmarks (Collatz, Fibonacci) use Dyalog mode. Sort uses ?N⍴N (integer data). Newton uses vectorized iteration. LCS uses nested dfns with trains, Each (¨), and Unique (∪). Lucky Numbers uses a recursive sieve with replicate and modulus.