#profiler #gamedev #gui

puffin_egui

Show puffin profiler flamegraph in-game using egui

17 releases (11 breaking)

new 0.12.0 Jan 11, 2022
0.11.0 Nov 16, 2021
0.10.3 Nov 8, 2021
0.4.1 Jul 5, 2021

#49 in Profiling

Download history 34/week @ 2021-09-25 16/week @ 2021-10-02 85/week @ 2021-10-09 50/week @ 2021-10-16 127/week @ 2021-10-23 194/week @ 2021-10-30 74/week @ 2021-11-06 151/week @ 2021-11-13 121/week @ 2021-11-20 360/week @ 2021-11-27 385/week @ 2021-12-04 247/week @ 2021-12-11 203/week @ 2021-12-18 75/week @ 2021-12-25 244/week @ 2022-01-01 119/week @ 2022-01-08

654 downloads per month
Used in 3 crates

MIT/Apache

61KB
1.5K SLoC

Show puffin profiler flamegraph in-game using egui

Embark Embark Crates.io Docs

puffin is an instrumentation profiler where you opt-in to profile parts of your code:

fn my_function() {
    puffin::profile_function!();
    if ... {
        puffin::profile_scope!("load_image", image_name);
        ...
    }
}

puffin_egui allows you to inspect the resulting profile data using egui with only one line of code:

puffin_egui::profiler_window(egui_ctx);

See the examples/ folder for how to use it with eframe or macroquad.

To try it out, run cargo run --release --example macroquad

Dependencies

~8.5MB
~154K SLoC