# Offline benchmarks The benchmark chapter of the tutorial runs its four methods in the browser through numbl. The scripts here run the two best of those methods, the harmonic basis and the graded-panel double layer, outside the browser, on the same Pac-Man problem, the same error lattice, and the same timing protocol (solve only, warmed up, minimum over repeats when a solve is under 5 ms). Run whichever of these your machine has, from the repository root: ``` python3 bench/python/bench_pacman.py # needs NumPy julia bench/julia/bench_pacman.jl # standard library only matlab -batch "run('bench/matlab/bench_pacman.m')" ``` Each writes a `bench-pacman-*.json` file (the MATLAB one lands in the repository root, the others in the current directory). Load those files from the "load offline results" button under the benchmark chapter's work-precision plot, and they appear as dashed curves beside the browser's. The point of running the scripts yourself, rather than reading times measured on someone else's machine, is that your browser results and your offline results then share a clock and can honestly share an axis. The MATLAB harness runs the chapter's own driver and editable script, unchanged, in real MATLAB. The Python and Julia scripts are ports; the check that they are faithful is that their error columns land on top of the browser's curves, since the error depends only on the mathematics. All three were verified to reproduce the browser's errors to plotting accuracy. ## The file format ```json { "schema": "laplace-dirichlet-bench-1", "label": "what the legend should call this run", "kind": "both", "date": "2026-08-20", "methods": [ { "name": "harmonic basis, least squares", "slot": "mps", "ns": [4, 8, 16], "E": [8.1e-4, 6.3e-6, 3.6e-10], "T": [0.2, 0.4, 0.9] } ] } ``` `slot` picks the plot colour and marker and is one of `fd2`, `fd4`, `spectral`, `fast`, `iterative`, `mps`, `bie`; anything else falls back to `fd2`. `E` is the maximum absolute error over the chapter's fixed interior lattice, `T` the solve time in milliseconds, and entries may be `null` for a resolution a method skipped. `kind` records which ground truth was measured (`both`, `sing`, or `smooth`); the page warns if it differs from the one the lab is currently showing. Nothing stops you from writing a file in this format from any other language or machine; the legend will say whatever `label` says.