#profiler #gamedev

puffin_egui

Show puffin profiler flamegraph in-game using egui

29 releases (breaking)

0.22.0 May 24, 2023
0.20.0 Feb 9, 2023
0.19.1 Dec 19, 2022
0.18.0 Nov 8, 2022
0.4.1 Jul 5, 2021

#32 in Profiling

Download history 4860/week @ 2023-06-01 7283/week @ 2023-06-08 5909/week @ 2023-06-15 5053/week @ 2023-06-22 5899/week @ 2023-06-29 4730/week @ 2023-07-06 2974/week @ 2023-07-13 3183/week @ 2023-07-20 2901/week @ 2023-07-27 3286/week @ 2023-08-03 2505/week @ 2023-08-10 1331/week @ 2023-08-17 1384/week @ 2023-08-24 1091/week @ 2023-08-31 1218/week @ 2023-09-07 1048/week @ 2023-09-14

4,874 downloads per month
Used in 5 crates

MIT/Apache

150KB
3.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

~6–11MB
~125K SLoC