Comparing solvers
Solver choice affects both how quickly the objective improves and which solution a run approaches. These comparisons run Basin’s optimizers from shared, randomly sampled starting points and track the objective gap against elapsed time.
Each run has a 20.00 ms time budget and stops early on reaching a gap of . The summaries report how often each solver reaches that target and how long the successful runs take. Expand the starting-point figures to inspect every run. For derivative and constraint requirements, read the solver selection guide.
Rosenbrock
This case has 10 parameters, with starting points sampled uniformly from . Every solver uses the same coordinates for a given seed, so differences within a panel reflect the solver’s behavior from that start.
Rosenbrock’s curved valley tests how an algorithm follows changing curvature. In this snapshot, BFGS and L-BFGS reach the target in tens of microseconds when successful, while several algorithms plateau at a positive objective gap on some starts. Fast progress on one start therefore needs to be read alongside target attainment across all starts.
| Solver | Starts reaching target | Median time when reached |
|---|---|---|
| Gradient Descent | 4 / 6 | 2.02 ms |
| Nelder–Mead | 5 / 6 | 734.7 µs |
| BFGS | 4 / 6 | 22.7 µs |
| L-BFGS | 5 / 6 | 33.9 µs |
| SLSQP | 3 / 6 | 465.6 µs |
| CMA-ES | 5 / 6 | 6.19 ms |
The median uses the first recorded timestamp at which the target is reached and includes only successful starts. Read it together with the count: a short conditional median does not describe runs that miss the target. This small set of starts is a comparison on this fixture, rather than an estimate of performance across all problems.
Starting points
Lower curves have smaller objective gaps; curves further left reach that accuracy sooner. Each panel has its own logarithmic axes. A curve ending above the target can reflect the time budget or another stopping condition, so its endpoint alone does not establish convergence.
Show all 6 starting points
wall-clock time
Methodology and reproduction
Measured 2026-09-16 on AMD Ryzen 9 7900 12-Core Processor (linux/x64).
Every solver uses Vec<f64> and the same 20.00 ms budget
per starting point. Each per-iteration timestamp is the median over 11
repetitions of the same deterministic run. The objective gap is floored at for display, which is also the target used in the summary.
Absolute times are machine-specific. These inexpensive test objectives also make solver implementation costs more visible than they would be when each evaluation takes substantial time. Use the library comparisons to compare implementations of an algorithm, or the backend comparisons to examine vector and matrix representations.
From the repository root, run the harness and collect its output:
mkdir -p target
cargo run -p competitor-bench --release --bin solver_compare > target/solver-traces.json
pnpm --dir web collect:solvers The solver harness defines the starts and configurations. The collection script saves the traces and machine metadata used by this page. You can also explore the algorithms in the interactive visualizer.