perf-plotter 0.1.1

Library for generate performance chart
Documentation
  • Coverage
  • 0%
    0 out of 5 items documented0 out of 0 items with examples
  • Size
  • Source code size: 175.24 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.52 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • cathay4t

Rust Crate for Generating Performance Chart

This crate will generate a PNG file for how much time did your function takes for each iteration.

Example code:

use perf_plotter::generate_performance_png;

fn main() {
    let data: Vec<u32> = (1..50).collect();

    generate_performance_png(
        test_fun,
        data.into_iter(),
        std::path::Path::new("/tmp/a.png"),
        "square_sleep",
    )
    .unwrap();
}

fn test_fun(time_ms: u32) -> Option<()> {
    std::thread::sleep(std::time::Duration::from_millis(time_ms.pow(2).into()));
    Some(())
}

Output