Summary
splu on 2D meshes and graphsmode="multifrontal" than simplicial LDLᵀ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
solveandqr: 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 thanspmmand 1.5–2.3× faster thanspspmm. - 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:
Show all problems for this metric as a table
Reading the results
- Low fill (2D meshes, graphs): the default
ldltfactors 1.8–6× faster than SciPy's defaultsplu, 1.2–2× faster thanspluin symmetric mode (even with it on the 512² grid), and 9–34% faster than CHOLMOD's simplicial mode.multifrontalcomes within about 15% of CHOLMOD's supernodal mode. - High fill (3D meshes): simplicial methods fall behind.
multifrontalfactors the 40³ grid in 1.29 s against 11.3 s forldlt, 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,
multifrontalranges from 1.4× slower to 1.2× faster than CHOLMOD, andldltis 1.6–3.5× slower. With 32 right-hand sides,multifrontalwas 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)
| Problem | pEigen ldlt | pEigen multifrontal | pEigen SparseLU | SciPy splu | SciPy splu (symmetric) | CHOLMOD simplicial, AMD | CHOLMOD auto, AMD | CHOLMOD auto, default ordering |
|---|---|---|---|---|---|---|---|---|
| 2D Laplacian 64² | 1.96 | 2.06 | 5.85 | 5.08 | 3.43 | 2.19 | 2.16 | 2.14 |
| 2D Laplacian 128² | 12.7 | 8.47 | 28.4 | 26.5 | 17.1 | 14.5 | 9.18 | 8.97 |
| 2D Laplacian 256² | 82.1 | 36.8 | 143.8 | 161.6 | 99.8 | 95.2 | 37.3 | 37.2 |
| 2D Laplacian 512² | 633.6 | 196.1 | 853 | 1,157 | 613.1 | 758.8 | 167.7 | 168.2 |
| 3D Laplacian 16³ | 18.8 | 6.56 | 33.9 | 41.4 | 18.7 | 19.9 | 4.86 | 4.87 |
| 3D Laplacian 24³ | 231.1 | 45.6 | 368.8 | 581.3 | 214.4 | 262.9 | 24.8 | 71.9 |
| 3D Laplacian 32³ | 2,200 | 289 | 2,611 | 3,831 | 1,526 | 2,615 | 115.8 | 214.2 |
| 3D Laplacian 40³ | 1.134e+04 | 1,287 | 1.354e+04 | 2.032e+04 | 6,546 | 1.007e+04 | 357.2 | 512.3 |
| kNN graph 10k | 8.83 | 9.22 | 35.4 | 32.8 | 16.3 | 10.1 | 9.09 | 9.09 |
| kNN graph 50k | 63.6 | 50.1 | 272.7 | 289.5 | 123 | 69.4 | 48.3 | 48.4 |
| kNN graph 200k | 400.6 | 239.1 | 2,117 | 2,300 | 811.7 | 537.5 | 224.6 | 223.4 |
Solve time, 32 right-hand sides (ms)
| Problem | pEigen ldlt | pEigen multifrontal | pEigen SparseLU | SciPy splu | SciPy splu (symmetric) | CHOLMOD simplicial, AMD | CHOLMOD auto, AMD | CHOLMOD auto, default ordering |
|---|---|---|---|---|---|---|---|---|
| 2D Laplacian 64² | 0.92 | 0.88 | 6.75 | 3.89 | 3.91 | 1.02 | 1.01 | 1 |
| 2D Laplacian 128² | 5.05 | 3.94 | 43.9 | 18.4 | 18.9 | 5.38 | 14.5 | 14.3 |
| 2D Laplacian 256² | 25 | 19.2 | 289.2 | 86.2 | 94.5 | 28.1 | 64.8 | 64.8 |
| 2D Laplacian 512² | 129.8 | 84.1 | 1,634 | 435.3 | 481.7 | 145 | 289.6 | 289.8 |
| 3D Laplacian 16³ | 3.43 | 1.16 | 33.9 | 12.2 | 7.7 | 2.81 | 5.08 | 5.08 |
| 3D Laplacian 24³ | 24.8 | 5.92 | 287.8 | 81.8 | 40.1 | 18.3 | 10.6 | 10.3 |
| 3D Laplacian 32³ | 106.6 | 21.7 | 1,081 | 370.7 | 168 | 80.4 | 61.2 | 60.2 |
| 3D Laplacian 40³ | 319.7 | 53.5 | 3,289 | 1,271 | 501.5 | 210.8 | 75 | 66.5 |
| kNN graph 10k | 2.52 | 2.25 | 31.6 | 11.9 | 6.97 | 3.09 | 3.34 | 3.34 |
| kNN graph 50k | 17.5 | 14.6 | 295.6 | 89.1 | 56.9 | 21.3 | 22.3 | 22.4 |
| kNN graph 200k | 91.3 | 69.3 | 1,769 | 476.9 | 451.1 | 108.5 | 104.2 | 104.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.
| Operation | pEigen call | Speed ratio (NumPy ÷ pEigen) | Result |
|---|---|---|---|
| Matrix multiply | linalg.matmul(a, b) | 0.86× – 0.94× | NumPy 6–16% faster |
| Linear solve | linalg.solve(a, b) | 0.99× – 1.84× | Even at 256×256; pEigen 1.6–1.8× faster from 1024×1024 |
| QR decomposition | linalg.qr(a) | 1.40× – 2.05× | pEigen faster |
| SVD | linalg.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 only | linalg.eighvals(a) | 0.96× – 0.97× | About even (NumPy 3–4% faster) |
| Frobenius norm | linalg.norm(a) | 1.27× – 1.38× | pEigen faster |
All dense measurements, including the eigen and lapack backends
Matmul (with copy-out)
| op | size | numpy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| matmul | 256x256 | 0.102 | 0.109 | 0.94x |
| matmul | 512x512 | 0.658 | 0.735 | 0.90x |
| matmul | 1024x1024 | 5.03 | 5.866 | 0.86x |
| matmul | 1024x256@256x128 | 0.156 | 0.171 | 0.91x |
| matmul | 512x128@128x64 | 0.036 | 0.039 | 0.93x |
| matmul | 256x1024@1024x512 | 0.617 | 0.655 | 0.94x |
Solve (with copy-out)
| op | size | numpy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| solve[eigen] | 256x256 | 0.282 | 0.31 | 0.91x |
| solve[lapack] | 256x256 | 0.282 | 0.267 | 1.06x |
| solve[auto] | 256x256 | 0.282 | 0.284 | 0.99x |
| solve[eigen] | 512x512 | 1.7 | 1.577 | 1.08x |
| solve[lapack] | 512x512 | 1.7 | 1.663 | 1.02x |
| solve[auto] | 512x512 | 1.7 | 1.631 | 1.04x |
| solve[eigen] | 1024x1024 | 14.326 | 9.966 | 1.44x |
| solve[lapack] | 1024x1024 | 14.326 | 7.915 | 1.81x |
| solve[auto] | 1024x1024 | 14.326 | 7.771 | 1.84x |
| solve[eigen] | 2048x2048 | 78.266 | 63.737 | 1.23x |
| solve[lapack] | 2048x2048 | 78.266 | 48.779 | 1.60x |
| solve[auto] | 2048x2048 | 78.266 | 48.769 | 1.60x |
| solve[eigen] | 256x256@4rhs | 0.295 | 0.362 | 0.82x |
| solve[lapack] | 256x256@4rhs | 0.295 | 0.282 | 1.05x |
| solve[auto] | 256x256@4rhs | 0.295 | 0.28 | 1.05x |
| solve[eigen] | 512x512@4rhs | 1.734 | 1.804 | 0.96x |
| solve[lapack] | 512x512@4rhs | 1.734 | 1.553 | 1.12x |
| solve[auto] | 512x512@4rhs | 1.734 | 1.56 | 1.11x |
| solve[eigen] | 1024x1024@4rhs | 14.298 | 11.403 | 1.25x |
| solve[lapack] | 1024x1024@4rhs | 14.298 | 8.593 | 1.66x |
| solve[auto] | 1024x1024@4rhs | 14.298 | 8.111 | 1.76x |
| solve[eigen] | 2048x2048@4rhs | 82.602 | 69.523 | 1.19x |
| solve[lapack] | 2048x2048@4rhs | 82.602 | 48.353 | 1.71x |
| solve[auto] | 2048x2048@4rhs | 82.602 | 49.055 | 1.68x |
Norm Frobenius (2D default)
| op | size | numpy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| norm | 256x256 | 0.011 | 0.009 | 1.31x |
| norm | 512x512 | 0.042 | 0.032 | 1.32x |
| norm | 1024x1024 | 0.17 | 0.131 | 1.30x |
| norm | 1024x256 | 0.042 | 0.033 | 1.27x |
| norm | 512x128 | 0.012 | 0.009 | 1.35x |
| norm | 256x1024 | 0.045 | 0.033 | 1.38x |
SVD with copy-out (U, s, Vt returned)
| op | size | numpy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| svd[bdcsvd] | 256x256 | 8.301 | 10.274 | 0.81x |
| svd[lapack] | 256x256 | 8.301 | 8.014 | 1.04x |
| svd[auto] | 256x256 | 8.301 | 8.066 | 1.03x |
| svd[bdcsvd] | 512x512 | 43.62 | 49.454 | 0.88x |
| svd[lapack] | 512x512 | 43.62 | 50.922 | 0.86x |
| svd[auto] | 512x512 | 43.62 | 44.27 | 0.99x |
| svd[bdcsvd] | 1024x1024 | 284.525 | 282.917 | 1.01x |
| svd[lapack] | 1024x1024 | 284.525 | 272.216 | 1.05x |
| svd[auto] | 1024x1024 | 284.525 | 272.84 | 1.04x |
| svd[bdcsvd] | 1024x256 | 20.881 | 17.258 | 1.21x |
| svd[lapack] | 1024x256 | 20.881 | 19.517 | 1.07x |
| svd[auto] | 1024x256 | 20.881 | 19.641 | 1.06x |
| svd[bdcsvd] | 512x128 | 5.415 | 3.296 | 1.64x |
| svd[lapack] | 512x128 | 5.415 | 4.245 | 1.28x |
| svd[auto] | 512x128 | 5.415 | 4.177 | 1.30x |
| svd[bdcsvd] | 256x1024 | 27.579 | 17.761 | 1.55x |
| svd[lapack] | 256x1024 | 27.579 | 26.451 | 1.04x |
| svd[auto] | 256x1024 | 27.579 | 26.563 | 1.04x |
SVD compute-only (minimal return; excludes U/V copy-out)
| op | size | numpy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| svd_compute[bdcsvd] | 256x256 | 7.9 | 10.443 | 0.76x |
| svd_compute[lapack] | 256x256 | 7.9 | 8.108 | 0.97x |
| svd_compute[auto] | 256x256 | 7.9 | 7.899 | 1.00x |
| svd_compute[bdcsvd] | 512x512 | 44.909 | 48.798 | 0.92x |
| svd_compute[lapack] | 512x512 | 44.909 | 43.176 | 1.04x |
| svd_compute[auto] | 512x512 | 44.909 | 42.837 | 1.05x |
| svd_compute[bdcsvd] | 1024x1024 | 273.213 | 275.25 | 0.99x |
| svd_compute[lapack] | 1024x1024 | 273.213 | 271.885 | 1.00x |
| svd_compute[auto] | 1024x1024 | 273.213 | 271.036 | 1.01x |
| svd_compute[bdcsvd] | 1024x256 | 21.986 | 16.904 | 1.30x |
| svd_compute[lapack] | 1024x256 | 21.986 | 19.258 | 1.14x |
| svd_compute[auto] | 1024x256 | 21.986 | 19.344 | 1.14x |
| svd_compute[bdcsvd] | 512x128 | 4.954 | 3.382 | 1.46x |
| svd_compute[lapack] | 512x128 | 4.954 | 3.98 | 1.24x |
| svd_compute[auto] | 512x128 | 4.954 | 3.864 | 1.28x |
| svd_compute[bdcsvd] | 256x1024 | 27.176 | 17.053 | 1.59x |
| svd_compute[lapack] | 256x1024 | 27.176 | 26.207 | 1.04x |
| svd_compute[auto] | 256x1024 | 27.176 | 26.296 | 1.03x |
QR with copy-out (Q, R returned, mode='reduced')
| op | size | numpy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| qr | 256x256 | 1.857 | 1.324 | 1.40x |
| qr | 512x512 | 9.203 | 5.688 | 1.62x |
| qr | 1024x1024 | 59.446 | 36.294 | 1.64x |
| qr | 2048x2048 | 432.218 | 233.359 | 1.85x |
| qr | 2048x1024 | 187.99 | 121.389 | 1.55x |
| qr | 1024x256 | 12.297 | 6.651 | 1.85x |
| qr | 512x128 | 2.481 | 1.208 | 2.05x |
Eigh with copy-out (eigenvalues and eigenvectors returned)
| op | size | numpy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| eigh[eigen] | 256x256 | 4.362 | 10.991 | 0.40x |
| eigh[lapack] | 256x256 | 4.362 | 4.26 | 1.02x |
| eigh[auto] | 256x256 | 4.362 | 4.335 | 1.01x |
| eigh[eigen] | 512x512 | 26.874 | 81.24 | 0.33x |
| eigh[lapack] | 512x512 | 26.874 | 23.361 | 1.15x |
| eigh[auto] | 512x512 | 26.874 | 23.334 | 1.15x |
| eigh[eigen] | 1024x1024 | 143.671 | 591.581 | 0.24x |
| eigh[lapack] | 1024x1024 | 143.671 | 156.079 | 0.92x |
| eigh[auto] | 1024x1024 | 143.671 | 146.631 | 0.98x |
Eigh eigenvalues only (no eigenvector copy-out)
| op | size | numpy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| eighvals[eigen] | 256x256 | 2.582 | 4.082 | 0.63x |
| eighvals[lapack] | 256x256 | 2.582 | 2.664 | 0.97x |
| eighvals[auto] | 256x256 | 2.582 | 2.685 | 0.96x |
| eighvals[eigen] | 512x512 | 15.429 | 22.425 | 0.69x |
| eighvals[lapack] | 512x512 | 15.429 | 15.899 | 0.97x |
| eighvals[auto] | 512x512 | 15.429 | 15.825 | 0.97x |
| eighvals[eigen] | 1024x1024 | 96.669 | 129.039 | 0.75x |
| eighvals[lapack] | 1024x1024 | 96.669 | 99.973 | 0.97x |
| eighvals[auto] | 1024x1024 | 96.669 | 99.958 | 0.97x |
Eigh eigenvalues compute-only (minimal return; excludes eigenvector copy-out)
| op | size | numpy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| eigh_compute[eigen] | 256x256 | 2.576 | 4.07 | 0.63x |
| eigh_compute[lapack] | 256x256 | 2.576 | 2.652 | 0.97x |
| eigh_compute[auto] | 256x256 | 2.576 | 2.673 | 0.96x |
| eigh_compute[eigen] | 512x512 | 14.938 | 22.274 | 0.67x |
| eigh_compute[lapack] | 512x512 | 14.938 | 15.658 | 0.95x |
| eigh_compute[auto] | 512x512 | 14.938 | 15.533 | 0.96x |
| eigh_compute[eigen] | 1024x1024 | 98.133 | 129.906 | 0.76x |
| eigh_compute[lapack] | 1024x1024 | 98.133 | 100.569 | 0.98x |
| eigh_compute[auto] | 1024x1024 | 98.133 | 101.109 | 0.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.
| Operation | pEigen call | Speed ratio (SciPy ÷ pEigen) | Result |
|---|---|---|---|
| Sparse @ dense | sparse.spmm(a, b) | 0.37× – 0.44× | SciPy faster |
| Sparse @ sparse | sparse.spspmm(a, b) | 0.43× – 0.68× | SciPy faster |
| CG, no preconditioner | sparse.solve(a, b, method="cg") | 1.09× – 3.00× | pEigen faster, most on small problems |
| CG, Jacobi | method="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 |
| BiCGSTAB | sparse.solve(a, b, method="bicgstab") | 1.36× – 3.48× | pEigen faster |
| Sparse LU factorize | sparse.factorize(a) | 0.83× – 0.93× | SciPy faster |
| Sparse LU factorize + solve | sparse.solve(a, b, method="lu") | 0.77× – 0.87× | SciPy faster |
All sparse measurements
Spmm (sparse @ dense; Laplacian operator)
| op | size | scipy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| spmm | 32x32 n=1024 | 0.013 | 0.034 | 0.38x |
| spmm | 45x45 n=2025 | 0.021 | 0.047 | 0.44x |
| spmm | 64x32 n=2048 | 0.021 | 0.048 | 0.43x |
| spmm | 64x64 n=4096 | 0.038 | 0.092 | 0.41x |
| spmm | 128x64 n=8192 | 0.073 | 0.183 | 0.40x |
| spmm | 128x128 n=16384 | 0.147 | 0.398 | 0.37x |
Spspmm (stiffness @ lumped mass, copy-out)
| op | size | scipy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| spspmm | 32x32 n=1024 | 0.04 | 0.059 | 0.68x |
| spspmm | 45x45 n=2025 | 0.057 | 0.099 | 0.57x |
| spspmm | 64x32 n=2048 | 0.055 | 0.1 | 0.56x |
| spspmm | 64x64 n=4096 | 0.088 | 0.182 | 0.48x |
| spspmm | 128x64 n=8192 | 0.157 | 0.355 | 0.44x |
| spspmm | 128x128 n=16384 | 0.309 | 0.725 | 0.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).
| op | size | scipy_p50(ms) | peigen_p50(ms) | speedup | iters (s/p) | resid (s/p) |
|---|---|---|---|---|---|---|
| sparse_solve[cg,none] | 32x32 n=1024 | 1.768 | 0.59 | 3.00x | 102/101 | 7.5e-09/7.5e-09 |
| sparse_solve[cg,jacobi] | 32x32 n=1024 | 2.295 | 0.623 | 3.69x | 102/101 | 7.5e-09/7.5e-09 |
| sparse_solve[cg,ilu] | 32x32 n=1024 | 1.7 | 1.22 | 1.39x | 3/2 | 9.2e-10/9.7e-09 |
| sparse_solve[cg,none] | 45x45 n=2025 | 3.249 | 1.711 | 1.90x | 141/140 | 9.5e-09/9.5e-09 |
| sparse_solve[cg,jacobi] | 45x45 n=2025 | 3.914 | 1.781 | 2.20x | 141/140 | 9.5e-09/9.5e-09 |
| sparse_solve[cg,ilu] | 45x45 n=2025 | 3.299 | 3.001 | 1.10x | 4/3 | 5.1e-11/1.2e-09 |
| sparse_solve[cg,none] | 64x32 n=2048 | 3.729 | 1.948 | 1.91x | 159/158 | 9.5e-09/9.5e-09 |
| sparse_solve[cg,jacobi] | 64x32 n=2048 | 4.406 | 1.977 | 2.23x | 159/158 | 9.5e-09/9.5e-09 |
| sparse_solve[cg,ilu] | 64x32 n=2048 | 3.287 | 3.059 | 1.07x | 4/3 | 7.2e-11/1.8e-09 |
| sparse_solve[cg,none] | 64x64 n=4096 | 6.785 | 4.934 | 1.38x | 199/198 | 9.2e-09/9.2e-09 |
| sparse_solve[cg,jacobi] | 64x64 n=4096 | 7.93 | 4.784 | 1.66x | 199/198 | 9.2e-09/9.2e-09 |
| sparse_solve[cg,ilu] | 64x64 n=4096 | 7.751 | 7.412 | 1.05x | 4/4 | 1.6e-10/1.8e-09 |
| sparse_solve[cg,none] | 128x64 n=8192 | 17.824 | 14.618 | 1.22x | 307/306 | 9.9e-09/9.9e-09 |
| sparse_solve[cg,jacobi] | 128x64 n=8192 | 20.284 | 14.512 | 1.40x | 307/306 | 9.9e-09/9.9e-09 |
| sparse_solve[cg,ilu] | 128x64 n=8192 | 15.772 | 18.259 | 0.86x | 4/6 | 4.2e-09/5.8e-09 |
| sparse_solve[cg,none] | 128x128 n=16384 | 39.775 | 36.493 | 1.09x | 387/386 | 9.4e-09/9.4e-09 |
| sparse_solve[cg,jacobi] | 128x128 n=16384 | 45.512 | 36.667 | 1.24x | 387/386 | 9.4e-09/9.4e-09 |
| sparse_solve[cg,ilu] | 128x128 n=16384 | 40.559 | 43.913 | 0.92x | 5/9 | 5.9e-09/5.6e-09 |
Sparse solve [BiCGSTAB] (setup + solve; advection–diffusion)
| op | size | scipy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| sparse_solve[bicgstab] | 32x32 n=1024 | 14.506 | 4.164 | 3.48x |
| sparse_solve[bicgstab] | 45x45 n=2025 | 26.208 | 10.927 | 2.40x |
| sparse_solve[bicgstab] | 64x32 n=2048 | 30.571 | 13.173 | 2.32x |
| sparse_solve[bicgstab] | 64x64 n=4096 | 54.8 | 30.223 | 1.81x |
| sparse_solve[bicgstab] | 128x64 n=8192 | 151.245 | 96.633 | 1.57x |
| sparse_solve[bicgstab] | 128x128 n=16384 | 338.411 | 248.912 | 1.36x |
Sparse factorize [LU] (pattern + numeric factorization; advection–diffusion)
| op | size | scipy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| sparse_factorize[lu] | 32x32 n=1024 | 1.163 | 1.384 | 0.84x |
| sparse_factorize[lu] | 45x45 n=2025 | 2.378 | 2.722 | 0.87x |
| sparse_factorize[lu] | 64x32 n=2048 | 2.2 | 2.64 | 0.83x |
| sparse_factorize[lu] | 64x64 n=4096 | 5.069 | 6.051 | 0.84x |
| sparse_factorize[lu] | 128x64 n=8192 | 10.641 | 12.111 | 0.88x |
| sparse_factorize[lu] | 128x128 n=16384 | 26.489 | 28.436 | 0.93x |
Sparse solve [LU] (factorize + solve; advection–diffusion)
| op | size | scipy_p50(ms) | peigen_p50(ms) | speedup |
|---|---|---|---|---|
| sparse_solve[lu] | 32x32 n=1024 | 1.299 | 1.685 | 0.77x |
| sparse_solve[lu] | 45x45 n=2025 | 2.696 | 3.427 | 0.79x |
| sparse_solve[lu] | 64x32 n=2048 | 2.534 | 3.218 | 0.79x |
| sparse_solve[lu] | 64x64 n=4096 | 6.041 | 7.58 | 0.80x |
| sparse_solve[lu] | 128x64 n=8192 | 12.45 | 15.472 | 0.80x |
| sparse_solve[lu] | 128x128 n=16384 | 30.824 | 35.563 | 0.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_THREADSandOPENBLAS_NUM_THREADSset 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:
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.pyThe 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.