1 unstable release

0.1.0 May 7, 2023

#311 in Profiling

MIT license

4KB

partial-callgrind


lib.rs:

Easy to use client requests to start/stop callgrind at specific location of your code for precise profiling (100% Rust).

For now only x86_64 is supported.

Examples

Skip Vec initialization code and profile only sort. Compile in release mode and then use valgrind --tool=callgrind --collect-atstart=no --instr-atstart=no {exec}.

use partial_callgrind::{start, stop};
use rand::Rng;

fn main() {
    let mut rng = rand::thread_rng();

    let mut data: Vec<u8> = (0..10_000).into_iter().map(|_| rng.gen::<u8>()).collect();
    start();
    data.sort();
    stop();
}

No runtime deps