#backtrace #perf #profiler #cpu #tools #codes #internal #match #help

rsperftools

An internal perf tools for rust programs

13 releases

✓ Uses Rust 2018 edition

0.3.3 Nov 1, 2019
0.3.2 Nov 1, 2019
0.2.3 Oct 31, 2019
0.1.4 Oct 25, 2019
Download history 70/week @ 2019-10-18 104/week @ 2019-10-25

78 downloads per month

Apache-2.0

28KB
845 lines

rsperftools


rsperftools::PROFILER.write().unwrap().start(100).unwrap();

// Some codes

match rsperftools::PROFILER.read().unwrap().report().build() {
    Ok(report) => {
        let file = File::create("flamegraph.svg").unwrap();
        report.flamegraph(file).unwrap();

        println!("report: {}", &report);
    }
    Err(_) => {}
};

Dependencies

~2MB
~39K SLoC