Crates.io | ubench |
lib.rs | ubench |
version | 0.0.0-alpha0 |
source | src |
created_at | 2022-12-08 23:28:01.267521 |
updated_at | 2022-12-08 23:28:01.267521 |
description | stopgap rust benchmarking solution for microcontrollers |
homepage | |
repository | https://github.com/rrbutani/ubench/ |
max_upload_size | |
id | 732878 |
size | 59,817 |
µbench
"micro bench", as in: microcontroller
This is a tiny crate that attempts to help you benchmark things running on microcontrollers.
This is not a particularly good crate. It:
test::bench
moduledefmt
ecosystem 1 (in order to support boards that do not have probe-rs
support)µbench
is very much intended to be a stopgap; it is my sincere hope that this crate will be obviated in the near future.
However, as of this writing, there seems to be a real dearth of solutions aimed at users who just want to: run some code on their device and get back cycle counts, without needing to spin up a debugger. Hence this crate.
The closest thing out there (that I am aware of) that serves this use case is liar
which is, unfortunately, just a tiny bit too barebones when the std
feature is disabled.
(overview of the traits:
Benchmark
which can be: fn
, closure impling FnMut
, custom impl with setup
+ teardown
Inp
data by referenceBenchmarkRunner
lets you actually run benchmarks; two kinds
single
)
Benchmark
implsuite
)
Benchmark
impls that are all run on the same input dataimpl IntoIterator<Item = T>
as an input source where T: Debug
0..10
), an array (["hey", "there"]
), an iterator ((0..10).map(|x| 2u32.pow(x))
), etc.Metric
Reporter
some way to report out the results of the benchmarking )