alphaville / optimization-engine

Nonconvex embedded optimization: code generation for fast real-time optimization + ROS support
https://alphaville.github.io/optimization-engine/
Other
499 stars 53 forks source link

Benchmarking framework #295

Closed alphaville closed 1 year ago

alphaville commented 1 year ago

Main Changes

Introduction of a benchmarking framework.

To run the benchmarks, you need to install:

pip install pytest-benchmark[histogram]

Then, firstly, create some necessary optimizers to be benchmarked

python prepare_benchmarks.py

Then benchmark them with

py.test test/benchmark_open.py --benchmark-warmup-iterations=20

To generate a fancy histogram (box plots) run

py.test test/benchmark_open.py --benchmark-warmup-iterations=20 --benchmark-histogram=out
# to convert the SVG file to PNG:
qlmanage -t -s 1000 -o . out.svg

The generated benchmark looks like this:

benchmark

Associated Issues

TODOs