Basin

Search documentation

Search the guides, solvers, and migration docs.

  • Guide
  • Visualizer
  • Benchmarks

Benchmarks

  • Overview
  • Comparing solvers
  • Comparing libraries
  • Choosing a backend
Navigation

Benchmarks

  • Overview
  • Comparing solvers
  • Comparing libraries
  • Choosing a backend

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 f(x)−f⋆f(\mathbf{x}) - f^\starf(x)−f⋆ against elapsed time.

Each run has a 20.00 ms time budget and stops early on reaching a gap of 10−1010^{-10}10−10. 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 [−2,2]n[-2, 2]^n[−2,2]n. 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.

Rosenbrock: target attainment and median time to an objective gap of 1e-10.
SolverStarts reaching targetMedian time when reached
Gradient Descent4 / 62.02 ms
Nelder–Mead5 / 6734.7 µs
BFGS4 / 622.7 µs
L-BFGS5 / 633.9 µs
SLSQP3 / 6465.6 µs
CMA-ES5 / 66.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
Gradient Descent Nelder–Mead BFGS L-BFGS SLSQP CMA-ES
suboptimality f(x) − f*
Seed 1 f(x₀) = 700
1e31e01e-31e-61e-91 µs10 µs100 µs1 ms10 ms
Seed 2 f(x₀) = 5836
1e41e11e-21e-51e-81 µs10 µs100 µs1 ms10 ms100 ms
Seed 3 f(x₀) = 3435
1e41e11e-21e-51e-81 µs10 µs100 µs1 ms10 ms
Seed 4 f(x₀) = 7689
1e41e11e-21e-51e-81 µs10 µs100 µs1 ms10 ms100 ms
Seed 5 f(x₀) = 2849
1e41e11e-21e-51e-81 µs10 µs100 µs1 ms10 ms
Seed 6 f(x₀) = 5014
1e41e11e-21e-51e-81 µs10 µs100 µs1 ms10 ms100 ms

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 10−1010^{-10}10−10 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.

Basin v3.2.0 — numerical optimization for Rust.

GitHub docs.rs crates.io