Numerical Computing Benchmark

12 operations  ·  15 languages  ·  speed & memory comparison

Python (NumPy) Python (Pandas) Python (Polars) Octave R Julia Rust C++ Haskell Swift Go Python (Numba) Python (JAX) C Fortran

Executive Summary

⚡ Speed Winner
🥇 C
Score: 43  |  Runner-up: Fortran (56)  |  3rd: Julia (65)
💾 Memory Winner
🥇 C
Score: 52  |  Runner-up: Python (JAX) (53)  |  3rd: Swift (56)
Gold Medals by Operation
  • C leads 5 operations: Matrix Inverse, LU Decomposition, Cholesky, Vector Dot Product, Hadamard Product
  • Fortran leads 2 operations: SVD, QR Decomposition
  • Julia leads 1 operation: Eigenvalue Decomp
  • Swift leads 1 operation: Linear System Solve
  • Python (Polars) leads 1 operation: Sort 10M floats
  • Python (JAX) leads 1 operation: Matrix Multiply
  • Rust leads 1 operation: FFT (real, 1M)
Two Performance Tiers

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.

Notable Findings
  • Swift/Accelerate is at the top on the factorisation ops (Cholesky, LU, QR), tying with C and Fortran (all call Accelerate) and beating Python/NumPy and Julia on each of them.
  • Sort: Python (Polars) is fastest; Python (Pandas) is ~18× and Swift ~13× slower, exposing meaningful differences in standard-library sort implementations at 10M elements.
  • Rust near-zero memory for Cholesky, LU Decomposition, QR Decomposition: nalgebra performs these factorisations in-place on the moved input, so no extra allocation is needed — correct behaviour, not a gap in measurement.
  • Haskell and Fortran have no FFT result (shown as —): Haskell's vector-fftw uses CDouble rather than Double, and Fortran has no standard FFT intrinsic. Python (JAX) has no Sort result.
  • Go has the worst overall speed score (summed per-operation ranks). Go/gonum is a pure-Go library with no LAPACK linkage and is slowest on several dense linear algebra ops.

Leaderboard — Golf Scoring (1st = 1 pt · lowest score wins)

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.

⚡ Speed Ranking

Ranked by mean execution time (ms) — lower is faster.

RankLanguageScoreMatMulInvLUEigenCholSVDLinSolveDotHadamardQRFFTSort
🥇 C4341111123113213
🥈 Fortran5622312212431—10
🥉 Julia65964149855482
#4 Python (NumPy)663411254588646
#5 Swift68532103319112118
#6 Python (Pandas)8175847666105314
#7 Python (Polars)971089514541215861
#8 C++971412679109277104
#9 R10787538810151411135
#10 Haskell1096914136771169—7
#11 Python (JAX)112110106121113132127—
#12 Rust1151315128131315391013
#13 Octave129121171411141171213512
#14 Python (Numba)12911131591012121041599
#15 Go165151413151515141413141211

💾 Memory Ranking

Ranked by peak memory usage (MB) — lower is leaner. Note: memory measurements are not apples-to-apples across languages (see Glossary).

RankLanguageScoreMatMulInvLUEigenCholSVDLinSolveDotHadamardQRFFTSort
🥇 C52166263451657
🥈 Python (JAX)5331252567322—
🥉 Swift56433636785344
#4 C++57277374562761
#5 Octave606551513107539
#6 Rust641421111111144113
#7 Fortran715444472964—8
#8 R8678878211188126
#9 Python (NumPy)11499118108813911711
#10 Python (Numba)128811101491412121010810
#11 Julia133111291312151431291112
#12 Go1341313141213131511114132
#13 Python (Polars)13815141391499141313105
#14 Python (Pandas)13912101210111010151412914
#15 Haskell1541015151515121321515—13

Language Summary

C
C (clang/Accelerate)
103.59avg ms
9.14avg MB
🥇 43score (lower=better)
Fortran
GNU Fortran GCC version 15.2.0
97.41avg ms
9.25avg MB
🥈 56score (lower=better)
Julia
Julia 1.12.5
18.88avg ms
16.53avg MB
🥉 65score (lower=better)
Python (NumPy)
Python 3.9.6 / NumPy 2.0.2
41.03avg ms
9.80avg MB
#4 66score (lower=better)
Swift
Swift / Accelerate (Apple vDSP+BLAS+LAPACK)
87.71avg ms
2.78avg MB
#5 68score (lower=better)
Python (Pandas)
Python 3.9.6 / Pandas 2.3.3
122.53avg ms
36.67avg MB
#6 81score (lower=better)
Python (Polars)
Python 3.9.6 / Polars 1.36.1
14.92avg ms
4.46avg MB
#7 97score (lower=better)
C++
C++17 / Eigen 3.5.0
33.75avg ms
2.78avg MB
#8 97score (lower=better)
R
R version 4.5.2 (2025-10-31)
45.56avg ms
9.17avg MB
#9 107score (lower=better)
Haskell
GHC 9.14.1 / hmatrix
97.70avg ms
36.45avg MB
#10 109score (lower=better)
Python (JAX)
Python 3.9.6 / JAX 0.4.30
13.67avg ms
3.04avg MB
#11 112score (lower=better)
Rust
rustc 1.94.1 (e408947bf 2026-03-25) / nalgebra 0.33
39.66avg ms
1.82avg MB
#12 115score (lower=better)
Octave
Octave 11.1.0
109.92avg ms
9.05avg MB
#13 129score (lower=better)
Python (Numba)
Python 3.9.6 / Numba 0.60.0
101.19avg ms
10.67avg MB
#14 129score (lower=better)
Go
Go 1.26.1 / gonum 0.15
120.35avg ms
6.50avg MB
#15 165score (lower=better)

Overview: All Operations

Execution Time (ms) — lower is better

Memory Allocated (MB) — lower is better

Per-Operation: Time vs Memory

Matrix Multiply
1000×1000 dense matrix multiplication (A @ B)
Matrix Inverse
Inversion of 500×500 SPD matrix
LU Decomposition
LU factorisation of 500×500 matrix
Eigenvalue Decomp
Full eigendecomposition of 300×300 symmetric matrix
Cholesky
Cholesky factorisation of 500×500 SPD matrix
SVD
Economy SVD of 500×300 matrix (U:500×300, S:300, Vt:300×300)
Linear System Solve
Solve Ax=b for 1000×1000 A, 1000 b
Vector Dot Product
Dot product of two 10M-element vectors
Hadamard Product
Element-wise multiply + add on 1000×1000 matrices
QR Decomposition
QR factorisation of 500×500 matrix
FFT (real, 1M)
Real FFT of 2²⁰=1M-element vector (numpy rfft)
Sort 10M floats
Unstable sort of 10M random float64 values (numpy sort)

Full Comparison Table

Time (ms): 🥇 fastest   background: fast → slow  |  Same scale for Memory (MB)
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)OctaveRJuliaRustC++HaskellSwiftGoPython (Numba)Python (JAX)CFortran
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.637.6615.487.637.637.649.71🥇 7.637.647.637.697.637.63🥇 7.637.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.911.913.921.911.912.18🥇 1.911.9124.85🥇 1.912.242.15🥇 1.911.911.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.745.745.741.911.911.93🥇 0.00761.91130.361.915.815.721.911.911.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.690.690.69🥇 0.690.691.480.690.693.380.690.812.090.690.690.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.911.913.921.911.911.92🥇 0.00001.917.451.913.861.911.911.911.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.831.841.84🥇 0.691.765.101.841.833.101.834.135.061.831.831.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.00860.00910.00890.0076🥇 0.00767.660.020.00767.640.00767.717.640.00760.00760.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.00010.00230.00020.00000.0000🥇 0.0000🥇 0.00000.0000🥇 0.00000.0000🥇 0.00000.00010.00000.00000.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.6315.267.857.637.637.647.63🥇 7.6315.267.637.637.637.63🥇 7.637.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.975.976.031.911.912.20🥇 0.00381.917.331.916.123.941.911.911.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.008.008.008.0016.008.02🥇 0.00008.00—8.0032.018.008.008.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.30391.010.000276.2968.66152.61🥇 0.0000🥇 0.0000193.89🥇 0.0000🥇 0.000076.30—76.2976.29

Glossary — What Each Benchmark Measures

01
Matrix Multiply Fastest: Python (JAX) 5.08 ms
A × B where A, B are 1000×1000

The 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.

02
Matrix Inverse Fastest: C 2.27 ms
A⁻¹ for a 500×500 symmetric positive-definite (SPD) matrix

Computed 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.

03
LU Decomposition Fastest: C 1.17 ms
A = P·L·U factorisation of a 500×500 matrix

Partial-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.

04
Eigenvalue Decomp Fastest: Julia 7.65 ms
Full symmetric eigendecomposition of a 300×300 matrix

Computes 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.

05
Cholesky Fastest: C 0.28 ms
L·Lᵀ factorisation of a 500×500 SPD matrix

The 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.

06
SVD Fastest: Fortran 13.31 ms
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.

07
Linear System Solve Fastest: Swift 3.23 ms
Solve Ax = b for 1000×1000 SPD A and 1000-element b

The 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.

08
Vector Dot Product Fastest: C 2.81 ms
x·y for two 10-million-element vectors

A 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.

09
Hadamard Product Fastest: C 0.58 ms
C = A ⊙ B + C for three 1000×1000 matrices

Element-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.

10
QR Decomposition Fastest: Fortran 2.29 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.

11
FFT (real, 1M) Fastest: Rust 4.34 ms
Real FFT of 2²⁰ = 1 048 576 samples

Fast 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).

12
Sort 10M floats Fastest: Python (Polars) 77.47 ms
Unstable sort of 10 million random float64 values

A 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.

Appendix — Changelog