Skip to content

Repository files navigation

embedded-math-benchmark-rs

Microbenchmarks comparing C and Rust math libraries on the compute-constrained microcontrollers used in multi-robot systems (STM32, RP2040, RP2350, ESP32-S3, nRF52840). One JSON config defines every task; proc-macros bake it into no_std firmware that runs on each platform and reports both cycle counts and numerical accuracy.

Documentation

Doc What it covers
Running the benchmarks Prerequisites, build, flash and run, per platform
Benchmark I/O format inputs.json in, BENCH CSV out
Targets and platforms Chips, target triples, timing sources, status
Task categories What each task measures, and which comparisons it supports
Build profiles release, lto, size, xlto, and when each is valid
Numerical accuracy ULP methodology, and what the accuracy CSV does not support
C reference suites crazyflie-fw and cmsis-dsp: provenance, naming, wrapper deviations
Benchmark report results.csv to report.pdf, and the paper figures
Adding a benchmark Recipe for a new task
Adding a platform Checklist for a new hardware target
HIL setup Probe provisioning, CI runners, troubleshooting

Quick start

cargo install cargo-make
cargo make bench-host | cargo make collect -- -o results.csv
cargo make report

Actual firmware runs need probe-rs and a connected probe, see running the benchmarks. Results land in results.csv and accuracy_results.csv and render to report.pdf.

Layout

  • benchmarks/: Cargo workspace. mrs-benchmark-core holds the traits, task registry and per-library suites; -macros bakes inputs.json in at build time; -host and one no_std crate per platform run it; -collect merges logs into results.csv
  • docs/
  • viz/: renders results.csv into report.pdf
  • tools/: standalone scripts (input generator, RP2350 rescue)

About

Benchmarking Rust and C Math Libraries for Embedded Robotics Applications

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages