27 releases (breaking)

0.22.0 May 24, 2023
0.20.1 Jan 30, 2023
0.19.0 Dec 13, 2022
0.18.0 Nov 8, 2022
0.5.0 Nov 15, 2020

#169 in Profiling

Download history 232/week @ 2023-08-12 342/week @ 2023-08-19 365/week @ 2023-08-26 231/week @ 2023-09-02 326/week @ 2023-09-09 254/week @ 2023-09-16 217/week @ 2023-09-23 228/week @ 2023-09-30 255/week @ 2023-10-07 236/week @ 2023-10-14 230/week @ 2023-10-21 307/week @ 2023-10-28 217/week @ 2023-11-04 230/week @ 2023-11-11 232/week @ 2023-11-18 260/week @ 2023-11-25

949 downloads per month
Used in 2 crates

MIT/Apache

135KB
3K SLoC

Puffin ImGui Flamegraph

Embark Embark Crates.io Docs

This crate provides a flamegraph view of the data collected by the Puffin profiler.

Example view

fn main() {
    puffin::set_scopes_on(true); // you may want to control this with a flag
    let mut puffin_ui = puffin_imgui::ProfilerUi::default();

    // game loop
    loop {
        puffin::GlobalProfiler::lock().new_frame();

        {
            puffin::profile_scope!("slow_code");
            slow_code();
        }

        puffin_ui.window(ui);
    }
}

lib.rs:

An imgui-rs interface for puffin.

Usage:

fn main() {
    puffin::set_scopes_on(true); // you may want to control this with a flag
    let mut puffin_ui = puffin_imgui::ProfilerUi::default();

    // game loop
    loop {
        puffin::GlobalProfiler::lock().new_frame();

        {
            puffin::profile_scope!("slow_code");
            slow_code();
        }

        puffin_ui.window(ui);
    }
}

Dependencies

~13–19MB
~272K SLoC