lpspec against linopy — how the engine scales

Build a model and hand it to HiGHS, with run() never called. Every point is one process, best of three, on an idle machine. The parity gate passed on all six models: the two lanes agree on the objective to 0.0e+00 relative (fleet to 4.6e-16), so nothing here is fast because it built a different model.

Does the advantage hold whatever the model looks like?

Against linopy on the same model and rung, so linopy is the flat 1.0 line. The line is the median across the six benchmark models; the band is the full min–max envelope. Below 1.0 is faster (left) or lighter (right). A band clear of 1.0 is a result that does not depend on which model you picked.

Wall time ÷ linopy
Peak RSS ÷ linopy

On time the band clears 1.0 at every rung but one. The worst model at xs is 0.15x and the median 0.08x; by l the band has widened to 0.30–1.09x, and its top edge is profiled — the one case where linopy finishes ahead. The advantage is largest where the model is small, which is the shape a rolling horizon rebuilds.

On memory the band straddles 1.0 and the spread is the story. At l, sector is 0.32x of linopy's peak and dispatch 0.95x — a threefold difference between two models at the same rung. Sparsity is what separates them: a coordinate that does not exist is an absent row here and a NaN in a dense array there, so the gap tracks how much of the product a model actually uses rather than how large it is.

Past the ladder — dispatch out to 120M variables

Log–log, so a straight line is a power law and its slope is the exponent. The 40M and 120M rungs are past anything the ladder covers — a 9.97 GB LP file on a 26 GB machine.

Wall time (s)
Peak RSS (GB)

Nothing falls over, and the gap widens rather than closes — at 120M this lane builds and loads in 35 s against linopy's 106, where at 10M it was 1.1 against 1.5. linopy's curve steepens above 10M and this one does not. Peak is the axis where there is no advantage left to find: 8.3 GB against 7.8, because past a certain size both lanes are holding the same model and the representation stops mattering. The 2xl rung is noisy between runs — 8–10 GB of peak on a 26 GB machine is where other things start to matter. Read the ordering, not the seconds.

Every model, on its own axes

Show

The detail the band flattens. profiled is the one model where linopy finishes ahead at the top rung — 2.61 s against 2.84 s — and it is why the polars wall band reaches 1.09 at l instead of staying under 1. It has the most distinct variables and the most per-variable arithmetic of the six, which is the shape a dense array suits best and a frame least; it is also the noisiest case here, reading 2.33 s to 2.84 s across repeats at ~4 GB resident. sector is the opposite end: sparse, and the one model where the peak gap is threefold.

The numbers

Rung

Bold is the better of the two on that model and metric.