import { AppBar, Container, createTheme, CssBaseline, Link, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, ThemeProvider, Toolbar, Typography, } from '@mui/material' import { BenchmarkRunner } from './components/BenchmarkRunner' import { NATIVE_REFERENCE, NATIVE_MAX_THREADS } from './data/nativeReference' const theme = createTheme({ palette: { mode: 'light', primary: { main: '#1565c0' } }, }) function App() { return ( matmul-bench GitHub Compares n×n matrix-matrix multiply (GEMM) across implementations running in the browser — plain JavaScript/TypeScript, a WebGPU compute shader, hand-optimized C compiled to WebAssembly (including a multi-threaded build), and libFLAME/BLIS (a real BLAS) compiled to WebAssembly, single- and multi-threaded — plus a fixed reference table from native LAPACK/OpenBLAS running outside the browser. Native reference: OpenBLAS dgemm Measured with native/bench_native.c outside the browser on one Linux desktop — hardware-dependent, for rough comparison only. Regenerate with{' '} native/build.sh && native/bench_native. {NATIVE_REFERENCE.length > 0 ? ( n 1 thread (GFLOP/s) {NATIVE_MAX_THREADS} threads (GFLOP/s) {NATIVE_REFERENCE.map((r) => ( {r.n} {r.gflops1t.toFixed(1)} {r.gflopsNt.toFixed(1)} ))}
) : ( (not yet captured) )} Threading overhead dominates at small n — the {NATIVE_MAX_THREADS}-thread column is slower than 1 thread below n≈512 on this machine. The threaded methods (custom C and libFLAME/BLIS) use WASM pthreads (Web Workers + SharedArrayBuffer) and need cross-origin isolation, provided here by a service worker; pick the thread count above. The libFLAME/BLIS methods link a real BLAS (BLIS generic C kernels with{' '} -msimd128) compiled to WebAssembly — see{' '} libflame2wasm{' '} — and get far closer to native single-threaded OpenBLAS than the hand-written C kernels. Part of the{' '} concept-collection.
) } export default App