Benchmarks

pEigen timed against SciPy, NumPy and CHOLMOD on the same machine, including the cases where pEigen is slower.

Summary

1.8–6×
faster sparse Cholesky factorization than SciPy's default splu on 2D meshes and graphs
3–9×
faster 3D-mesh factorization with mode="multifrontal" than simplicial LDLᵀ
1.1–4.4×
faster 32-RHS solves than CHOLMOD's best mode, on all 11 problems

Where pEigen is a good fit

  • Sparse SPD factorizations on 2D meshes and graphs, and any workload that solves many right-hand sides with one matrix.
  • Refactorizing with the same pattern, and log-determinants.
  • Dense solve and qr: 1.0–2× faster than NumPy at moderate and large sizes.
  • Iterative CG and BiCGSTAB: 1.1–3.7× faster than SciPy, mostly from lower per-iteration overhead.

Where something else is faster

  • Factorizing 3D meshes: CHOLMOD's supernodal mode is 1.3–3.6× faster than pEigen's multifrontal mode single-threaded, and further ahead with threads.
  • Sparse products: SciPy's @ is 2.3–2.7× faster than spmm and 1.5–2.3× faster than spspmm.
  • General sparse LU: SciPy's SuperLU is 7–30% faster than SparseLU.
  • Dense matmul: 6–16% slower than NumPy (both call Accelerate).

Sparse Cholesky

Eleven SPD test problems: 2D and 3D finite-difference Laplacians, and graph Laplacians of k-nearest-neighbor graphs on random points (which resemble unstructured meshes and GP precision matrices). Every solver runs single-threaded. Pick a problem and a metric:

Factorization time
Show all problems for this metric as a table

Reading the results

  • Low fill (2D meshes, graphs): the default ldlt factors 1.8–6× faster than SciPy's default splu, 1.2–2× faster than splu in symmetric mode (even with it on the 512² grid), and 9–34% faster than CHOLMOD's simplicial mode. multifrontal comes within about 15% of CHOLMOD's supernodal mode.
  • High fill (3D meshes): simplicial methods fall behind. multifrontal factors the 40³ grid in 1.29 s against 11.3 s for ldlt, but CHOLMOD's supernodal mode takes 0.36 s. Across the 3D meshes CHOLMOD is 1.3–3.6× faster. Its default ordering strategy, which can choose nested dissection, also stores 38% fewer nonzeros on 40³ than pEigen's AMD-ordered factor.
  • Solves: with one right-hand side, multifrontal ranges from 1.4× slower to 1.2× faster than CHOLMOD, and ldlt is 1.6–3.5× slower. With 32 right-hand sides, multifrontal was the fastest solver on every problem. Its first many-RHS solve after each factorization builds a blocked copy of L, a one-time cost of 0.25–0.65× the factorization.
Static tables (factor and 32-RHS solve times, ms)

Factorization time (ms)

ProblempEigen ldltpEigen multifrontalpEigen SparseLUSciPy spluSciPy splu (symmetric)CHOLMOD simplicial, AMDCHOLMOD auto, AMDCHOLMOD auto, default ordering
2D Laplacian 64²1.962.065.855.083.432.192.162.14
2D Laplacian 128²12.78.4728.426.517.114.59.188.97
2D Laplacian 256²82.136.8143.8161.699.895.237.337.2
2D Laplacian 512²633.6196.18531,157613.1758.8167.7168.2
3D Laplacian 16³18.86.5633.941.418.719.94.864.87
3D Laplacian 24³231.145.6368.8581.3214.4262.924.871.9
3D Laplacian 32³2,2002892,6113,8311,5262,615115.8214.2
3D Laplacian 40³1.134e+041,2871.354e+042.032e+046,5461.007e+04357.2512.3
kNN graph 10k8.839.2235.432.816.310.19.099.09
kNN graph 50k63.650.1272.7289.512369.448.348.4
kNN graph 200k400.6239.12,1172,300811.7537.5224.6223.4

Solve time, 32 right-hand sides (ms)

ProblempEigen ldltpEigen multifrontalpEigen SparseLUSciPy spluSciPy splu (symmetric)CHOLMOD simplicial, AMDCHOLMOD auto, AMDCHOLMOD auto, default ordering
2D Laplacian 64²0.920.886.753.893.911.021.011
2D Laplacian 128²5.053.9443.918.418.95.3814.514.3
2D Laplacian 256²2519.2289.286.294.528.164.864.8
2D Laplacian 512²129.884.11,634435.3481.7145289.6289.8
3D Laplacian 16³3.431.1633.912.27.72.815.085.08
3D Laplacian 24³24.85.92287.881.840.118.310.610.3
3D Laplacian 32³106.621.71,081370.716880.461.260.2
3D Laplacian 40³319.753.53,2891,271501.5210.87566.5
kNN graph 10k2.522.2531.611.96.973.093.343.34
kNN graph 50k17.514.6295.689.156.921.322.322.4
kNN graph 200k91.369.31,769476.9451.1108.5104.2104.4

Dense routines vs NumPy

Square and rectangular matrices up to 2048×2048, using each function's default method="auto". Both libraries call Apple Accelerate, with default threading. Times include returning the results as NumPy arrays. The ratio is NumPy's time divided by pEigen's, so a value above 1× means pEigen is faster.

OperationpEigen callSpeed ratio (NumPy ÷ pEigen)Result
Matrix multiplylinalg.matmul(a, b)0.86× – 0.94×NumPy 6–16% faster
Linear solvelinalg.solve(a, b)0.99× – 1.84×Even at 256×256; pEigen 1.6–1.8× faster from 1024×1024
QR decompositionlinalg.qr(a)1.40× – 2.05×pEigen faster
SVDlinalg.svd(a)0.99× – 1.30×Even on square matrices; pEigen faster on rectangular ones
Symmetric eigen (values and vectors)linalg.eigh(a)0.98× – 1.15×About even
Symmetric eigenvalues onlylinalg.eighvals(a)0.96× – 0.97×About even (NumPy 3–4% faster)
Frobenius normlinalg.norm(a)1.27× – 1.38×pEigen faster
All dense measurements, including the eigen and lapack backends

Matmul (with copy-out)

opsizenumpy_p50(ms)peigen_p50(ms)speedup
matmul256x2560.1020.1090.94x
matmul512x5120.6580.7350.90x
matmul1024x10245.035.8660.86x
matmul1024x256@256x1280.1560.1710.91x
matmul512x128@128x640.0360.0390.93x
matmul256x1024@1024x5120.6170.6550.94x

Solve (with copy-out)

opsizenumpy_p50(ms)peigen_p50(ms)speedup
solve[eigen]256x2560.2820.310.91x
solve[lapack]256x2560.2820.2671.06x
solve[auto]256x2560.2820.2840.99x
solve[eigen]512x5121.71.5771.08x
solve[lapack]512x5121.71.6631.02x
solve[auto]512x5121.71.6311.04x
solve[eigen]1024x102414.3269.9661.44x
solve[lapack]1024x102414.3267.9151.81x
solve[auto]1024x102414.3267.7711.84x
solve[eigen]2048x204878.26663.7371.23x
solve[lapack]2048x204878.26648.7791.60x
solve[auto]2048x204878.26648.7691.60x
solve[eigen]256x256@4rhs0.2950.3620.82x
solve[lapack]256x256@4rhs0.2950.2821.05x
solve[auto]256x256@4rhs0.2950.281.05x
solve[eigen]512x512@4rhs1.7341.8040.96x
solve[lapack]512x512@4rhs1.7341.5531.12x
solve[auto]512x512@4rhs1.7341.561.11x
solve[eigen]1024x1024@4rhs14.29811.4031.25x
solve[lapack]1024x1024@4rhs14.2988.5931.66x
solve[auto]1024x1024@4rhs14.2988.1111.76x
solve[eigen]2048x2048@4rhs82.60269.5231.19x
solve[lapack]2048x2048@4rhs82.60248.3531.71x
solve[auto]2048x2048@4rhs82.60249.0551.68x

Norm Frobenius (2D default)

opsizenumpy_p50(ms)peigen_p50(ms)speedup
norm256x2560.0110.0091.31x
norm512x5120.0420.0321.32x
norm1024x10240.170.1311.30x
norm1024x2560.0420.0331.27x
norm512x1280.0120.0091.35x
norm256x10240.0450.0331.38x

SVD with copy-out (U, s, Vt returned)

opsizenumpy_p50(ms)peigen_p50(ms)speedup
svd[bdcsvd]256x2568.30110.2740.81x
svd[lapack]256x2568.3018.0141.04x
svd[auto]256x2568.3018.0661.03x
svd[bdcsvd]512x51243.6249.4540.88x
svd[lapack]512x51243.6250.9220.86x
svd[auto]512x51243.6244.270.99x
svd[bdcsvd]1024x1024284.525282.9171.01x
svd[lapack]1024x1024284.525272.2161.05x
svd[auto]1024x1024284.525272.841.04x
svd[bdcsvd]1024x25620.88117.2581.21x
svd[lapack]1024x25620.88119.5171.07x
svd[auto]1024x25620.88119.6411.06x
svd[bdcsvd]512x1285.4153.2961.64x
svd[lapack]512x1285.4154.2451.28x
svd[auto]512x1285.4154.1771.30x
svd[bdcsvd]256x102427.57917.7611.55x
svd[lapack]256x102427.57926.4511.04x
svd[auto]256x102427.57926.5631.04x

SVD compute-only (minimal return; excludes U/V copy-out)

opsizenumpy_p50(ms)peigen_p50(ms)speedup
svd_compute[bdcsvd]256x2567.910.4430.76x
svd_compute[lapack]256x2567.98.1080.97x
svd_compute[auto]256x2567.97.8991.00x
svd_compute[bdcsvd]512x51244.90948.7980.92x
svd_compute[lapack]512x51244.90943.1761.04x
svd_compute[auto]512x51244.90942.8371.05x
svd_compute[bdcsvd]1024x1024273.213275.250.99x
svd_compute[lapack]1024x1024273.213271.8851.00x
svd_compute[auto]1024x1024273.213271.0361.01x
svd_compute[bdcsvd]1024x25621.98616.9041.30x
svd_compute[lapack]1024x25621.98619.2581.14x
svd_compute[auto]1024x25621.98619.3441.14x
svd_compute[bdcsvd]512x1284.9543.3821.46x
svd_compute[lapack]512x1284.9543.981.24x
svd_compute[auto]512x1284.9543.8641.28x
svd_compute[bdcsvd]256x102427.17617.0531.59x
svd_compute[lapack]256x102427.17626.2071.04x
svd_compute[auto]256x102427.17626.2961.03x

QR with copy-out (Q, R returned, mode='reduced')

opsizenumpy_p50(ms)peigen_p50(ms)speedup
qr256x2561.8571.3241.40x
qr512x5129.2035.6881.62x
qr1024x102459.44636.2941.64x
qr2048x2048432.218233.3591.85x
qr2048x1024187.99121.3891.55x
qr1024x25612.2976.6511.85x
qr512x1282.4811.2082.05x

Eigh with copy-out (eigenvalues and eigenvectors returned)

opsizenumpy_p50(ms)peigen_p50(ms)speedup
eigh[eigen]256x2564.36210.9910.40x
eigh[lapack]256x2564.3624.261.02x
eigh[auto]256x2564.3624.3351.01x
eigh[eigen]512x51226.87481.240.33x
eigh[lapack]512x51226.87423.3611.15x
eigh[auto]512x51226.87423.3341.15x
eigh[eigen]1024x1024143.671591.5810.24x
eigh[lapack]1024x1024143.671156.0790.92x
eigh[auto]1024x1024143.671146.6310.98x

Eigh eigenvalues only (no eigenvector copy-out)

opsizenumpy_p50(ms)peigen_p50(ms)speedup
eighvals[eigen]256x2562.5824.0820.63x
eighvals[lapack]256x2562.5822.6640.97x
eighvals[auto]256x2562.5822.6850.96x
eighvals[eigen]512x51215.42922.4250.69x
eighvals[lapack]512x51215.42915.8990.97x
eighvals[auto]512x51215.42915.8250.97x
eighvals[eigen]1024x102496.669129.0390.75x
eighvals[lapack]1024x102496.66999.9730.97x
eighvals[auto]1024x102496.66999.9580.97x

Eigh eigenvalues compute-only (minimal return; excludes eigenvector copy-out)

opsizenumpy_p50(ms)peigen_p50(ms)speedup
eigh_compute[eigen]256x2562.5764.070.63x
eigh_compute[lapack]256x2562.5762.6520.97x
eigh_compute[auto]256x2562.5762.6730.96x
eigh_compute[eigen]512x51214.93822.2740.67x
eigh_compute[lapack]512x51214.93815.6580.95x
eigh_compute[auto]512x51214.93815.5330.96x
eigh_compute[eigen]1024x102498.133129.9060.76x
eigh_compute[lapack]1024x102498.133100.5690.98x
eigh_compute[auto]1024x102498.133101.1090.97x

Sparse routines vs SciPy

2D grid operators from 1,024 to 16,384 unknowns: a 5-point Laplacian (SPD, for CG and the products) and an upwind advection–diffusion operator (nonsymmetric, for LU and BiCGSTAB). Products and BiCGSTAB use 8 right-hand sides; CG uses 1. Iterative solvers run to a relative residual of 1e-8, and both libraries' true residuals were checked to reach it. The ratio is SciPy's time divided by pEigen's.

OperationpEigen callSpeed ratio (SciPy ÷ pEigen)Result
Sparse @ densesparse.spmm(a, b)0.37× – 0.44×SciPy faster
Sparse @ sparsesparse.spspmm(a, b)0.43× – 0.68×SciPy faster
CG, no preconditionersparse.solve(a, b, method="cg")1.09× – 3.00×pEigen faster, most on small problems
CG, Jacobimethod="cg", preconditioner="jacobi"1.24× – 3.69×pEigen faster, most on small problems
CG, ILU (fill 40)method="cg", preconditioner="ilu"0.86× – 1.39×Mixed: pEigen faster on small grids, SciPy on the largest
BiCGSTABsparse.solve(a, b, method="bicgstab")1.36× – 3.48×pEigen faster
Sparse LU factorizesparse.factorize(a)0.83× – 0.93×SciPy faster
Sparse LU factorize + solvesparse.solve(a, b, method="lu")0.77× – 0.87×SciPy faster
All sparse measurements

Spmm (sparse @ dense; Laplacian operator)

opsizescipy_p50(ms)peigen_p50(ms)speedup
spmm32x32 n=10240.0130.0340.38x
spmm45x45 n=20250.0210.0470.44x
spmm64x32 n=20480.0210.0480.43x
spmm64x64 n=40960.0380.0920.41x
spmm128x64 n=81920.0730.1830.40x
spmm128x128 n=163840.1470.3980.37x

Spspmm (stiffness @ lumped mass, copy-out)

opsizescipy_p50(ms)peigen_p50(ms)speedup
spspmm32x32 n=10240.040.0590.68x
spspmm45x45 n=20250.0570.0990.57x
spspmm64x32 n=20480.0550.10.56x
spspmm64x64 n=40960.0880.1820.48x
spspmm128x64 n=81920.1570.3550.44x
spspmm128x128 n=163840.3090.7250.43x

Sparse solve [CG] (setup + solve; 2D Laplacian, SPD; single RHS)

Speedup only when both sides converge; same (A, b) per grid across preconditioners. ILU: SciPy spilu(fill=20, drop_tol=0.0001); pEigen IncompleteLUT(fill=40, drop_tol=0.0001).

opsizescipy_p50(ms)peigen_p50(ms)speedupiters (s/p)resid (s/p)
sparse_solve[cg,none]32x32 n=10241.7680.593.00x102/1017.5e-09/7.5e-09
sparse_solve[cg,jacobi]32x32 n=10242.2950.6233.69x102/1017.5e-09/7.5e-09
sparse_solve[cg,ilu]32x32 n=10241.71.221.39x3/29.2e-10/9.7e-09
sparse_solve[cg,none]45x45 n=20253.2491.7111.90x141/1409.5e-09/9.5e-09
sparse_solve[cg,jacobi]45x45 n=20253.9141.7812.20x141/1409.5e-09/9.5e-09
sparse_solve[cg,ilu]45x45 n=20253.2993.0011.10x4/35.1e-11/1.2e-09
sparse_solve[cg,none]64x32 n=20483.7291.9481.91x159/1589.5e-09/9.5e-09
sparse_solve[cg,jacobi]64x32 n=20484.4061.9772.23x159/1589.5e-09/9.5e-09
sparse_solve[cg,ilu]64x32 n=20483.2873.0591.07x4/37.2e-11/1.8e-09
sparse_solve[cg,none]64x64 n=40966.7854.9341.38x199/1989.2e-09/9.2e-09
sparse_solve[cg,jacobi]64x64 n=40967.934.7841.66x199/1989.2e-09/9.2e-09
sparse_solve[cg,ilu]64x64 n=40967.7517.4121.05x4/41.6e-10/1.8e-09
sparse_solve[cg,none]128x64 n=819217.82414.6181.22x307/3069.9e-09/9.9e-09
sparse_solve[cg,jacobi]128x64 n=819220.28414.5121.40x307/3069.9e-09/9.9e-09
sparse_solve[cg,ilu]128x64 n=819215.77218.2590.86x4/64.2e-09/5.8e-09
sparse_solve[cg,none]128x128 n=1638439.77536.4931.09x387/3869.4e-09/9.4e-09
sparse_solve[cg,jacobi]128x128 n=1638445.51236.6671.24x387/3869.4e-09/9.4e-09
sparse_solve[cg,ilu]128x128 n=1638440.55943.9130.92x5/95.9e-09/5.6e-09

Sparse solve [BiCGSTAB] (setup + solve; advection–diffusion)

opsizescipy_p50(ms)peigen_p50(ms)speedup
sparse_solve[bicgstab]32x32 n=102414.5064.1643.48x
sparse_solve[bicgstab]45x45 n=202526.20810.9272.40x
sparse_solve[bicgstab]64x32 n=204830.57113.1732.32x
sparse_solve[bicgstab]64x64 n=409654.830.2231.81x
sparse_solve[bicgstab]128x64 n=8192151.24596.6331.57x
sparse_solve[bicgstab]128x128 n=16384338.411248.9121.36x

Sparse factorize [LU] (pattern + numeric factorization; advection–diffusion)

opsizescipy_p50(ms)peigen_p50(ms)speedup
sparse_factorize[lu]32x32 n=10241.1631.3840.84x
sparse_factorize[lu]45x45 n=20252.3782.7220.87x
sparse_factorize[lu]64x32 n=20482.22.640.83x
sparse_factorize[lu]64x64 n=40965.0696.0510.84x
sparse_factorize[lu]128x64 n=819210.64112.1110.88x
sparse_factorize[lu]128x128 n=1638426.48928.4360.93x

Sparse solve [LU] (factorize + solve; advection–diffusion)

opsizescipy_p50(ms)peigen_p50(ms)speedup
sparse_solve[lu]32x32 n=10241.2991.6850.77x
sparse_solve[lu]45x45 n=20252.6963.4270.79x
sparse_solve[lu]64x32 n=20482.5343.2180.79x
sparse_solve[lu]64x64 n=40966.0417.580.80x
sparse_solve[lu]128x64 n=819212.4515.4720.80x
sparse_solve[lu]128x128 n=1638430.82435.5630.87x

Methodology

  • Machine: Apple M1 Pro (10 cores), macOS.
  • Software: pEigen 2.1.0 (Eigen master, 2026-11-22), Python 3.14.6, NumPy 2.5.0 and SciPy 1.18.0 (both on Accelerate), scikit-sparse 0.5.1 for CHOLMOD.
  • Timing: median (p50) of repeated runs after warm-up, wall-clock, one benchmark at a time on an otherwise idle machine.
  • Threads: the sparse Cholesky comparison is single-threaded (OMP_NUM_THREADS, VECLIB_MAXIMUM_THREADS and OPENBLAS_NUM_THREADS set to 1). The dense and sparse comparisons use default threading.
  • Factor time includes symbolic analysis (ordering and elimination tree) plus the numeric factorization. Refactor is the numeric phase only, with the same pattern and new values.
  • Measured on 2026-11-25. Results on Linux with OpenBLAS will differ, especially for dense routines.

Reproduce

The scripts live in the repository's benchmarks/ folder:

bash
git clone --recurse-submodules https://github.com/TtheBC01/pEigen.git
cd pEigen
python -m pip install -e ".[benchmark,sparse]"
python benchmarks/bench_dense.py
python benchmarks/bench_sparse.py
OMP_NUM_THREADS=1 VECLIB_MAXIMUM_THREADS=1 OPENBLAS_NUM_THREADS=1 \
  python benchmarks/bench_cholesky.py

The CHOLMOD columns need scikit-sparse, which builds against SuiteSparse; DEV.md shows how. Without it, bench_cholesky.py compares against SciPy only. Run the benchmarks one at a time: concurrent runs compete for cores and memory bandwidth and skew each other.