Skip to main content

QP solvers benchmark

CI Coverage Conda version PyPI version

Benchmark for quadratic programming (QP) solvers available in Python.

The objective is to compare and select the best QP solvers for given use cases. The benchmarking methodology is open to discussions. Standard and community test sets are available: all of them can be processed using the qpbenchmark command-line tool, resulting in standardized reports evaluating all metrics across all QP solvers available on the test machine.

Test sets

The benchmark comes with standard and community test sets to represent different use cases for QP solvers:

New test sets are welcome! The qpbenchmark tool is designed to make it easy to wrap up a new test set without re-implementing the benchmark methodology. Check out the contribution guidelines to get started.

Solvers

The benchmark includes the following solvers:

Solver Keyword Algorithm Matrices License
Clarabel clarabel Interior point Sparse Apache-2.0
CVXOPT cvxopt Interior point Dense GPL-3.0
DAQP daqp Active set Dense MIT
ECOS ecos Interior point Sparse GPL-3.0
Gurobi gurobi Interior point Sparse Commercial
HiGHS highs Active set Sparse MIT
HPIPM hpipm Interior point Dense BSD-2-Clause
jaxopt.OSQP jaxopt_osqp Augmented Lagrangian Dense Apache-2.0
KVXOPT kvxopt Interior point Dense & Sparse GPL-3.0
MOSEK mosek Interior point Sparse Commercial
NPPro nppro Active set Dense Commercial
OSQP osqp Douglas–Rachford Sparse Apache-2.0
PIQP piqp Proximal Interior Point Dense & Sparse BSD-2-Clause
ProxQP proxqp Augmented Lagrangian Dense & Sparse BSD-2-Clause
QPALM qpalm Augmented Lagrangian Sparse LGPL-3.0
qpax qpax Interior point Dense MIT
qpOASES qpoases Active set Dense LGPL-2.1
qpSWIFT qpswift Interior point Sparse GPL-3.0
quadprog quadprog Goldfarb-Idnani Dense GPL-2.0
SCS scs Douglas–Rachford Sparse MIT
SIP sip Augmented Barrier Lagrangian Sparse MIT

Solvers are interfaced via qpsolvers and configured in solver_settings.py.

Metrics

We evaluate QP solvers based on the following metrics:

  • Success rate: percentage of problems a solver is able to solve on a given test set.
  • Computation time: time a solver takes to solve a given problem.
  • Optimality conditions: we evaluate all three optimality conditions:
    • Primal residual: maximum error on equality and inequality constraints at the returned solution.
    • Dual residual: maximum error on the dual feasibility condition at the returned solution.
    • Duality gap: value of the duality gap at the returned solution.

Shifted geometric mean

Each metric (computation time, primal and dual residuals, duality gap) produces a different ranking of solvers for each problem. To aggregate those rankings into a single metric over the whole test set, we use the shifted geometric mean (shm), which is a standard to aggregate computation times in benchmarks for optimization software. This mean has the advantage of being compromised by neither large outliers (as opposed to the arithmetic mean) nor by small outliers (in contrast to the geometric geometric mean). Check out the references below for further details.

Intuitively, a solver with a shifted-geometric-mean runtime of $Y$ is $Y$ times slower than the best solver over the test set. Similarly, a solver with a shifted-geometric-mean primal residual $R$ is $R$ times less accurate on equality and inequality constraints than the best solver over the test set.

Results

The outcome from running a test set is a standardized report comparing solvers against the different metrics. Here are the results for the various qpbenchmark test sets:

You can check out results from a variety of machines, and share the reports produced by running the benchmark on your own machine, in the Results category of the discussions forum of each test set.

Limitations

Here are some known areas of improvement for this benchmark:

Check out the issue tracker for ongoing works and future improvements.

Installation

We recommend installing the benchmark in its own environment using conda:

conda install qpbenchmark

Alternatively, you can install the benchmarking tool individually by pip install qpbenchmark. In that case, the benchmark will run on all supported solvers it can import.

Usage

The benchmark works by running qpbenchmark on a Python script describing the test set. For instance:

qpbenchmark my_test_set.py run

The test-set script is followed by a benchmark command, such as "run" here. We can add optional arguments to run a specific solver, problem, or solver settings:

qpbenchmark my_test_set.py run --solver proxqp --settings default

Check out qpbenchmark --help for a list of available commands and arguments.

Plots

The command line ships a plot command to compare solver performances over a test set for a specific metric. For instance, run:

qpbenchmark maros_meszaros_dense.py plot runtime high_accuracy

To generate the following plot:

image

Contributing

Contributions to improving this benchmark are welcome. You can for instance propose new problems, or share the runtimes you obtain on your machine. Check out the contribution guidelines for details.

Citation

If you use qpbenchmark in your works, please cite all its contributors as follows:

@software{qpbenchmark,
  title = {{qpbenchmark: Benchmark for quadratic programming solvers available in Python}},
  author = {Caron, Stéphane and Zaki, Akram and Otta, Pavel and Arnström, Daniel and Carpentier, Justin and Yang, Fengyu and Leziart, Pierre-Alexandre and Sousa Pinto, João},
  url = {https://github.com/qpsolvers/qpbenchmark},
  license = {Apache-2.0},
  version = {2.6.0},
  year = {2026}
}

Don't forget to add yourself to the BibTeX above and to CITATION.cff if you contribute to this repository.

See also

References

Other benchmarks

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qpbenchmark-2.6.0.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qpbenchmark-2.6.0-py3-none-any.whl (36.5 kB view details)

Uploaded Python 3

File details

Details for the file qpbenchmark-2.6.0.tar.gz.

File metadata

  • Download URL: qpbenchmark-2.6.0.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.4

File hashes

Hashes for qpbenchmark-2.6.0.tar.gz
Algorithm Hash digest
SHA256 5322f5b9c427444916abc2f9626e017ed104af4def6d9f4260490643b85d31ce
MD5 54bba1b64b27c45d995237a19e646beb
BLAKE2b-256 8142db223d899912ea3be88d4a9debd14679fbf11280a35ecdbb78175ae0cee3

See more details on using hashes here.

File details

Details for the file qpbenchmark-2.6.0-py3-none-any.whl.

File metadata

  • Download URL: qpbenchmark-2.6.0-py3-none-any.whl
  • Upload date:
  • Size: 36.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.4

File hashes

Hashes for qpbenchmark-2.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b4099046a5ac71d1cbe986c1f9f7bb503ff57aca895d294c4aee4c3decac716
MD5 cca85c80a825a47eebeaf6872b2af4d5
BLAKE2b-256 1cdb80e2bbdc6a3af43af0d21d0370825c0ca68099a5a3eb5693107e1b7a3f69

See more details on using hashes here.

Release history Release notifications | RSS feed

2.7.1

2 files

2.7.0

2 files

This release

2.6.0 This release

2 files

2.5.0

2 files

2.4.0

2 files

2.3.0

2 files

2.2.3

2 files

2.2.2

2 files

2.2.1

2 files

2.2.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

1.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page