12 operations · 15 languages · speed & memory comparison
BLAS/LAPACK-linked (C, Fortran, Haskell, Julia, Python (JAX), Python (NumPy), Python (Pandas), Python (Polars), R, Swift): call hand-optimised vendor routines (Apple Accelerate on this machine) for dense matrix work — on the factorisation and solver benchmarks the fastest BLAS-linked result is 2–5× faster than the fastest pure implementation (best vs best, per operation).
Pure implementations (C++, Go, Rust): Rust/nalgebra, C++/Eigen, Go/gonum implement their own algorithms without calling LAPACK. Slower on BLAS-heavy ops, but competitive on element-wise and algorithm-class workloads.
Each cell shows a language's finishing position for that operation. Scores are summed across all operations. Languages with no result for an operation (Fortran/FFT, Haskell/FFT, JAX/Sort) are charged one point more than the last-placed language for that op.
Ranked by mean execution time (ms) — lower is faster.
| Rank | Language | Score | MatMul | Inv | LU | Eigen | Chol | SVD | LinSolve | Dot | Hadamard | QR | FFT | Sort |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 🥇 | C | 43 | 4 | 1 | 1 | 11 | 1 | 2 | 3 | 1 | 1 | 3 | 2 | 13 |
| 🥈 | Fortran | 56 | 2 | 2 | 3 | 12 | 2 | 1 | 2 | 4 | 3 | 1 | — | 10 |
| 🥉 | Julia | 65 | 9 | 6 | 4 | 1 | 4 | 9 | 8 | 5 | 5 | 4 | 8 | 2 |
| #4 | Python (NumPy) | 66 | 3 | 4 | 11 | 2 | 5 | 4 | 5 | 8 | 8 | 6 | 4 | 6 |
| #5 | Swift | 68 | 5 | 3 | 2 | 10 | 3 | 3 | 1 | 9 | 11 | 2 | 11 | 8 |
| #6 | Python (Pandas) | 81 | 7 | 5 | 8 | 4 | 7 | 6 | 6 | 6 | 10 | 5 | 3 | 14 |
| #7 | Python (Polars) | 97 | 10 | 8 | 9 | 5 | 14 | 5 | 4 | 12 | 15 | 8 | 6 | 1 |
| #8 | C++ | 97 | 14 | 12 | 6 | 7 | 9 | 10 | 9 | 2 | 7 | 7 | 10 | 4 |
| #9 | R | 107 | 8 | 7 | 5 | 3 | 8 | 8 | 10 | 15 | 14 | 11 | 13 | 5 |
| #10 | Haskell | 109 | 6 | 9 | 14 | 13 | 6 | 7 | 7 | 11 | 6 | 9 | — | 7 |
| #11 | Python (JAX) | 112 | 1 | 10 | 10 | 6 | 12 | 11 | 13 | 13 | 2 | 12 | 7 | — |
| #12 | Rust | 115 | 13 | 15 | 12 | 8 | 13 | 13 | 15 | 3 | 9 | 10 | 1 | 3 |
| #13 | Octave | 129 | 12 | 11 | 7 | 14 | 11 | 14 | 11 | 7 | 12 | 13 | 5 | 12 |
| #14 | Python (Numba) | 129 | 11 | 13 | 15 | 9 | 10 | 12 | 12 | 10 | 4 | 15 | 9 | 9 |
| #15 | Go | 165 | 15 | 14 | 13 | 15 | 15 | 15 | 14 | 14 | 13 | 14 | 12 | 11 |
Ranked by peak memory usage (MB) — lower is leaner. Note: memory measurements are not apples-to-apples across languages (see Glossary).
| Rank | Language | Score | MatMul | Inv | LU | Eigen | Chol | SVD | LinSolve | Dot | Hadamard | QR | FFT | Sort |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 🥇 | C | 52 | 1 | 6 | 6 | 2 | 6 | 3 | 4 | 5 | 1 | 6 | 5 | 7 |
| 🥈 | Python (JAX) | 53 | 3 | 1 | 2 | 5 | 2 | 5 | 6 | 7 | 3 | 2 | 2 | — |
| 🥉 | Swift | 56 | 4 | 3 | 3 | 6 | 3 | 6 | 7 | 8 | 5 | 3 | 4 | 4 |
| #4 | C++ | 57 | 2 | 7 | 7 | 3 | 7 | 4 | 5 | 6 | 2 | 7 | 6 | 1 |
| #5 | Octave | 60 | 6 | 5 | 5 | 1 | 5 | 1 | 3 | 10 | 7 | 5 | 3 | 9 |
| #6 | Rust | 64 | 14 | 2 | 1 | 11 | 1 | 11 | 11 | 4 | 4 | 1 | 1 | 3 |
| #7 | Fortran | 71 | 5 | 4 | 4 | 4 | 4 | 7 | 2 | 9 | 6 | 4 | — | 8 |
| #8 | R | 86 | 7 | 8 | 8 | 7 | 8 | 2 | 1 | 11 | 8 | 8 | 12 | 6 |
| #9 | Python (NumPy) | 114 | 9 | 9 | 11 | 8 | 10 | 8 | 8 | 13 | 9 | 11 | 7 | 11 |
| #10 | Python (Numba) | 128 | 8 | 11 | 10 | 14 | 9 | 14 | 12 | 12 | 10 | 10 | 8 | 10 |
| #11 | Julia | 133 | 11 | 12 | 9 | 13 | 12 | 15 | 14 | 3 | 12 | 9 | 11 | 12 |
| #12 | Go | 134 | 13 | 13 | 14 | 12 | 13 | 13 | 15 | 1 | 11 | 14 | 13 | 2 |
| #13 | Python (Polars) | 138 | 15 | 14 | 13 | 9 | 14 | 9 | 9 | 14 | 13 | 13 | 10 | 5 |
| #14 | Python (Pandas) | 139 | 12 | 10 | 12 | 10 | 11 | 10 | 10 | 15 | 14 | 12 | 9 | 14 |
| #15 | Haskell | 154 | 10 | 15 | 15 | 15 | 15 | 12 | 13 | 2 | 15 | 15 | — | 13 |
| Operation | Time (ms) mean ± std | Memory (MB) | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Python (NumPy) Python 3.9.6 / NumPy 2.0.2 | Python (Pandas) Python 3.9.6 / Pandas 2.3.3 | Python (Polars) Python 3.9.6 / Polars 1.36.1 | Octave Octave 11.1.0 | R R version 4.5.2 (2025-10-31) | Julia Julia 1.12.5 | Rust rustc 1.94.1 (e408947bf 2026-03-25) / nalgebra 0.33 | C++ C++17 / Eigen 3.5.0 | Haskell GHC 9.14.1 / hmatrix | Swift Swift / Accelerate (Apple vDSP+BLAS+LAPACK) | Go Go 1.26.1 / gonum 0.15 | Python (Numba) Python 3.9.6 / Numba 0.60.0 | Python (JAX) Python 3.9.6 / JAX 0.4.30 | C C (clang/Accelerate) | Fortran GNU Fortran GCC version 15.2.0 |
Python (NumPy) | Python (Pandas) | Python (Polars) | Octave | R | Julia | Rust | C++ | Haskell | Swift | Go | Python (Numba) | Python (JAX) | C | Fortran | |
| Matrix Multiply 1000×1000 dense matrix multiplication (A @ B) | 7.21 ±0.26 | 8.81 ±0.28 | 16.89 ±0.21 | 23.93 ±4.01 | 9.60 ±1.07 | 12.57 ±1.64 | 44.30 ±0.37 | 46.32 ±1.26 | 8.11 ±0.86 | 7.97 ±0.34 | 80.23 ±2.11 | 21.08 ±1.89 | 🥇 5.08 ±0.58 | 7.31 ±0.36 | 7.13 ±0.25 | 7.63 | 7.66 | 15.48 | 7.63 | 7.63 | 7.64 | 9.71 | 🥇 7.63 | 7.64 | 7.63 | 7.69 | 7.63 | 7.63 | 🥇 7.63 | 7.63 |
| Matrix Inverse Inversion of 500×500 SPD matrix | 2.88 ±0.15 | 2.92 ±0.12 | 6.61 ±0.12 | 9.52 ±0.69 | 4.50 ±0.53 | 3.13 ±0.12 | 35.52 ±0.37 | 9.56 ±0.21 | 8.63 ±0.28 | 2.66 ±0.29 | 28.57 ±0.56 | 11.27 ±4.63 | 8.92 ±3.45 | 🥇 2.27 ±0.44 | 2.57 ±0.17 | 1.91 | 1.91 | 3.92 | 1.91 | 1.91 | 2.18 | 🥇 1.91 | 1.91 | 24.85 | 🥇 1.91 | 2.24 | 2.15 | 🥇 1.91 | 1.91 | 1.91 |
| LU Decomposition LU factorisation of 500×500 matrix | 7.47 ±4.07 | 3.79 ±1.43 | 4.91 ±1.49 | 3.04 ±0.14 | 2.50 ±0.53 | 1.68 ±0.37 | 10.03 ±0.11 | 2.64 ±0.02 | 19.87 ±1.03 | 1.19 ±0.04 | 11.28 ±0.33 | 37.03 ±0.34 | 6.00 ±3.16 | 🥇 1.17 ±0.03 | 1.24 ±0.14 | 5.74 | 5.74 | 5.74 | 1.91 | 1.91 | 1.93 | 🥇 0.0076 | 1.91 | 130.36 | 1.91 | 5.81 | 5.72 | 1.91 | 1.91 | 1.91 |
| Eigenvalue Decomp Full eigendecomposition of 300×300 symmetric matrix | 10.10 ±3.17 | 10.63 ±3.92 | 11.35 ±3.57 | 27.98 ±1.53 | 10.40 ±1.17 | 🥇 7.65 ±0.71 | 16.43 ±0.06 | 16.28 ±0.07 | 25.71 ±0.39 | 20.65 ±0.26 | 40.81 ±0.25 | 18.73 ±6.77 | 15.41 ±3.83 | 20.74 ±0.13 | 24.52 ±0.24 | 0.69 | 0.69 | 0.69 | 🥇 0.69 | 0.69 | 1.48 | 0.69 | 0.69 | 3.38 | 0.69 | 0.81 | 2.09 | 0.69 | 0.69 | 0.69 |
| Cholesky Cholesky factorisation of 500×500 SPD matrix | 0.94 ±0.40 | 1.10 ±0.50 | 7.20 ±4.41 | 2.31 ±0.81 | 1.30 ±0.67 | 0.83 ±0.24 | 4.54 ±0.03 | 1.45 ±0.02 | 0.95 ±0.02 | 0.35 ±0.01 | 9.88 ±0.16 | 1.95 ±1.07 | 3.02 ±1.34 | 🥇 0.28 ±0.0045 | 0.33 ±0.0026 | 1.91 | 1.91 | 3.92 | 1.91 | 1.91 | 1.92 | 🥇 0.0000 | 1.91 | 7.45 | 1.91 | 3.86 | 1.91 | 1.91 | 1.91 | 1.91 |
| SVD Economy SVD of 500×300 matrix (U:500×300, S:300, Vt:300×300) | 13.75 ±0.24 | 13.90 ±0.24 | 13.90 ±0.18 | 73.92 ±3.07 | 15.60 ±0.52 | 25.25 ±12.41 | 55.79 ±1.30 | 25.89 ±0.69 | 15.03 ±1.50 | 13.73 ±0.70 | 117.97 ±0.59 | 55.70 ±20.11 | 46.85 ±10.79 | 13.65 ±0.20 | 🥇 13.31 ±0.28 | 1.83 | 1.84 | 1.84 | 🥇 0.69 | 1.76 | 5.10 | 1.84 | 1.83 | 3.10 | 1.83 | 4.13 | 5.06 | 1.83 | 1.83 | 1.83 |
| Linear System Solve Solve Ax=b for 1000×1000 A, 1000 b | 5.45 ±0.34 | 5.51 ±0.20 | 5.17 ±0.11 | 13.84 ±2.19 | 12.30 ±1.42 | 7.86 ±1.59 | 79.41 ±2.77 | 10.97 ±4.95 | 7.59 ±0.38 | 🥇 3.23 ±0.25 | 50.38 ±1.04 | 20.21 ±0.30 | 20.46 ±6.02 | 4.52 ±0.42 | 4.43 ±0.15 | 0.0086 | 0.0091 | 0.0089 | 0.0076 | 🥇 0.0076 | 7.66 | 0.02 | 0.0076 | 7.64 | 0.0076 | 7.71 | 7.64 | 0.0076 | 0.0076 | 0.0076 |
| Vector Dot Product Dot product of two 10M-element vectors | 3.31 ±0.67 | 3.07 ±0.25 | 12.72 ±0.72 | 3.10 ±0.12 | 14.40 ±0.52 | 2.99 ±0.31 | 2.96 ±0.32 | 2.88 ±0.18 | 10.31 ±0.31 | 3.33 ±0.63 | 13.09 ±0.23 | 4.01 ±1.14 | 12.95 ±0.11 | 🥇 2.81 ±0.11 | 2.96 ±0.49 | 0.0001 | 0.0023 | 0.0002 | 0.0000 | 0.0000 | 🥇 0.0000 | 🥇 0.0000 | 0.0000 | 🥇 0.0000 | 0.0000 | 🥇 0.0000 | 0.0001 | 0.0000 | 0.0000 | 0.0000 |
| Hadamard Product Element-wise multiply + add on 1000×1000 matrices | 0.83 ±0.06 | 1.32 ±0.05 | 8.62 ±0.46 | 1.56 ±0.33 | 1.60 ±0.52 | 0.70 ±0.14 | 0.95 ±0.08 | 0.81 ±0.12 | 0.73 ±0.14 | 1.34 ±0.49 | 1.60 ±0.18 | 0.64 ±0.02 | 0.62 ±0.05 | 🥇 0.58 ±0.05 | 0.63 ±0.08 | 7.63 | 15.26 | 7.85 | 7.63 | 7.63 | 7.64 | 7.63 | 🥇 7.63 | 15.26 | 7.63 | 7.63 | 7.63 | 7.63 | 🥇 7.63 | 7.63 |
| QR Decomposition QR factorisation of 500×500 matrix | 5.51 ±0.24 | 5.34 ±0.14 | 6.03 ±0.38 | 34.42 ±18.40 | 17.70 ±0.95 | 2.78 ±0.05 | 15.72 ±0.26 | 6.01 ±0.06 | 13.35 ±0.62 | 2.44 ±0.13 | 45.35 ±6.06 | 45.70 ±20.34 | 20.27 ±2.98 | 2.66 ±0.48 | 🥇 2.29 ±0.08 | 5.97 | 5.97 | 6.03 | 1.91 | 1.91 | 2.20 | 🥇 0.0038 | 1.91 | 7.33 | 1.91 | 6.12 | 3.94 | 1.91 | 1.91 | 1.91 |
| FFT (real, 1M) Real FFT of 2²⁰=1M-element vector (numpy rfft) | 6.97 ±0.39 | 6.58 ±0.15 | 8.21 ±1.72 | 7.60 ±0.43 | 59.80 ±0.42 | 10.99 ±0.43 | 🥇 4.34 ±0.09 | 19.44 ±1.17 | — | 20.73 ±0.40 | 24.05 ±0.37 | 13.65 ±6.78 | 10.76 ±5.01 | 5.38 ±0.25 | — | 8.00 | 8.00 | 8.00 | 8.00 | 16.00 | 8.02 | 🥇 0.0000 | 8.00 | — | 8.00 | 32.01 | 8.00 | 8.00 | 8.00 | — |
| Sort 10M floats Unstable sort of 10M random float64 values (numpy sort) | 427.91 ±3.58 | 1407.44 ±63.26 | 🥇 77.47 ±9.67 | 1117.88 ±14.93 | 397.00 ±9.63 | 150.15 ±7.63 | 205.94 ±0.38 | 262.72 ±4.30 | 964.42 ±6.00 | 974.94 ±23.54 | 1021.04 ±16.00 | 984.31 ±9.37 | — | 1181.72 ±8.18 | 1012.09 ±14.21 | 76.30 | 391.01 | 0.0002 | 76.29 | 68.66 | 152.61 | 🥇 0.0000 | 🥇 0.0000 | 193.89 | 🥇 0.0000 | 🥇 0.0000 | 76.30 | — | 76.29 | 76.29 |
A × B where A, B are 1000×1000The canonical dense linear algebra kernel. Measures peak BLAS DGEMM throughput. BLAS-linked languages call cblas_dgemm (O(n³) with SIMD/multi-core optimisation); pure implementations use naive or cache-blocked loops. Results vary by 2–10× depending on whether vendor BLAS is used.
A⁻¹ for a 500×500 symmetric positive-definite (SPD) matrixComputed via LU factorisation (DGETRF) followed by triangular solve (DGETRI). Matrix inversion is rarely used directly in practice — solving Ax=b with Linear System Solve is numerically preferable — but it is a standard benchmark for full LAPACK integration.
A = P·L·U factorisation of a 500×500 matrixPartial-pivot LU (DGETRF) is the workhorse factorisation underlying matrix inversion and general linear solves. Measures LAPACK integration and cache efficiency on a medium-sized problem. Often the fastest path for non-symmetric systems.
Full symmetric eigendecomposition of a 300×300 matrixComputes all eigenvalues and eigenvectors of a symmetric matrix (DSYEV/DSYEVD). Used in PCA, graph algorithms, quantum mechanics, and structural analysis. Iterative reduction to tridiagonal form makes this slower than Cholesky but faster than general (non-symmetric) eigen for the same size.
L·Lᵀ factorisation of a 500×500 SPD matrixThe fastest dense factorisation for symmetric positive-definite matrices (DPOTRF). Half the cost of LU due to symmetry exploitation. Used in Kalman filters, Gaussian processes, and least-squares problems. A sensitive indicator of raw BLAS Level-3 throughput.
Full thin SVD of a 500×300 matrix (U, Σ, Vᵀ)Singular Value Decomposition (DGESDD) is the foundation of dimensionality reduction (PCA/LSA), pseudo-inverse computation, and low-rank approximation. Uses a divide-and-conquer algorithm internally. More expensive than Cholesky or LU due to iterative bidiagonalisation.
Solve Ax = b for 1000×1000 SPD A and 1000-element bThe practical alternative to matrix inversion: factorises A (Cholesky for SPD or LU for general) then performs triangular solves. The correct numerical approach for Ax=b. Larger problem size (1000) than the factorisation benchmarks to stress memory bandwidth alongside compute.
x·y for two 10-million-element vectorsA memory-bandwidth-bound BLAS Level-1 operation (DDOT). At 10M doubles the vectors exceed typical L3 cache, so performance reflects RAM bandwidth and SIMD utilisation rather than arithmetic throughput. Exposes overhead from interpreted dispatch (R, Python) vs compiled tight loops.
C = A ⊙ B + C for three 1000×1000 matricesElement-wise (pointwise) multiply-then-add — not a BLAS operation, so every language must loop over 1M doubles itself. Tests compiler vectorisation (SIMD auto-vectorisation in Rust/C++/Julia) and interpreter overhead (Python, R). In the committed results the compiled/JIT languages (C, Fortran, JAX, Numba) tie near 0.6 ms.
Householder QR of a 500×500 matrix (R factor)QR factorisation (DGEQRF) underpins least-squares solvers, eigenvalue algorithms, and orthogonalisation. Only the compact R factor is forced in all languages; forming the full Q is significantly more expensive. Haskell in particular would be ~400× slower if Q were materialised via its Haskell-level Householder products.
Real FFT of 2²⁰ = 1 048 576 samplesFast Fourier Transform (O(n log n)) is the backbone of signal processing, audio/image analysis, spectral methods, and fast polynomial multiplication. Completely different algorithm class from BLAS. Implementations range from FFTW (near-optimal, used by Python/NumPy and Julia/FFTW.jl) to RustFFT (pure-Rust) and gonum's pure-Go FFT. Haskell and Fortran have no FFT entry (N/A).
Unstable sort of 10 million random float64 valuesA pure-algorithm, comparison-based sort workload with no linear-algebra library involvement. Tests the quality of each language's standard-library sort (introsort, pdqsort, radix sort). At 10M elements the working set exceeds L3 cache, making memory-access pattern and branch-prediction efficiency critical. Results span a 7× range across languages.
jax.block_until_ready() ensures async dispatch completes before
the timer stops. Memory is theoretical (XLA allocations bypass
tracemalloc).cblas_dgemm
for matmul, dgetrf/dgetri/dsyev/dpotrf/dgesdd/dgesv/dgeqrf for
decompositions, vDSP_fft_zripD for FFT, and
qsort for sort. Memory is theoretical.vDSP_ctozD takes its input stride in units of
DSPDoubleComplex (2 doubles). The original stride of 2 read
every other complex pair — x[0,1], x[4,5],
x[8,9]… — silently skipping half the input.
The FFT was operating on decimated data with wrong frequencies and magnitudes.
Fixed to IC=1 (consecutive complex pairs: x[0,1],
x[2,3], x[4,5]…).
"Sort" instead of
"Sort 10M floats", causing the report to create a phantom
13th column where Fortran competed alone (winning rank 1 automatically)
while being absent from the real sort column. Fixed to match all other
languages.A = B·Bᵀ + n·I). Fixed — Fortran
now builds SPD A via DGEMM('N','T',...) + diagonal shift.
jnp.sort uses XLA's bitonic sort algorithm, which is designed
for GPU/TPU parallelism and runs ~50× slower on CPU than
numpy.sort (~5 900 ms vs ~60–400 ms for other languages).
Including it normalised the entire Sort heatmap column to a 0–5 900 ms
scale, compressing every other language into an indistinguishable
pale-green band. Sort is now omitted for Python (JAX), like FFT for
Haskell and FFT for Fortran.
fft(v) and sliced the result to N/2+1 outputs.
The slice (f = f(1:N_FFT/2+1)) was inside the
tic/toc block, adding an ~8 MB array copy to every
measurement. Moved outside the timer.
Corrected Octave FFT: ~6.9 ms (was ~70 ms).
blas_langs contained the bare string "Python"
after the rename to "Python (NumPy)" — all Python variants
were silently excluded from the BLAS-tier description in the Executive
Summary. (2) The .chg-new CSS class was used in the changelog
but never defined, rendering the "new" badge invisible (white text on
transparent background). (3) The <title> tag was
hardcoded as "8 Languages" while the subtitle already used
{len(langs)} dynamically; now both are dynamic.
DataFrame @ DataFrame matmul,
Series.dot(), Series.sort_values(), and
element-wise df * df + df for Hadamard;
numpy/scipy handle decompositions via .to_numpy().
Python (Polars) uses Polars Series/DataFrames similarly —
notably, Polars' native radix sort (~75 ms) is 6× faster
than NumPy sort and 18× faster than Pandas sort for 10 M floats.
Octave 11.1.0 runs all 12 operations through its
built-in BLAS/LAPACK, with JSON written without any package dependency.
Complex::new(x, 0.0) value and running a full N-point complex
FFT — roughly 2× the work of every other language, which all use a
real-to-complex FFT producing N/2+1 outputs.
Switched to the realfft crate (a thin wrapper around rustfft)
for a proper real-to-complex transform; plan creation moved to setup so
only the transform itself is timed.
Corrected Rust FFT: ~4 ms (was ~8 ms).
full_matrices=False, thinSVD,
ComputeThinU|ComputeThinV, dgesdd 'S',
svd 'econ') but all descriptions read "Full SVD".
Updated to "Economy SVD" with explicit output shapes (U: m×min(m,n))
across all 9 affected files.
fft()) on real input,
returning N complex outputs rather than the N/2+1 outputs produced
by rfft-based implementations in other languages.
Descriptions updated to reflect this, explaining the large gap
(R: ~63 ms vs Python NumPy rfft: ~7 ms).
luPacked + evaluate.
However, GHC's evaluate only forces the outermost constructor
to WHNF; the underlying LAPACK dgetrf call remained a thunk,
producing spurious 0.00 ms / 0.00 MB results.
Fixed by forcing the explicit L and U factor matrices
(lu m with forceM l >> forceM u),
which drives evaluation all the way through.
Corrected timings: 17.29 ms, 130.36 MB.
Thanks @jonocarroll
for the contribution!