#profiler #gamedev

puffin_egui

Show puffin profiler flamegraph in-game using egui

34 releases (breaking)

0.27.0 Apr 6, 2024
0.26.0 Feb 14, 2024
0.25.0 Jan 17, 2024
0.24.0 Nov 24, 2023
0.4.1 Jul 5, 2021

#161 in Profiling

Download history 2666/week @ 2024-01-27 2848/week @ 2024-02-03 1872/week @ 2024-02-10 1903/week @ 2024-02-17 1950/week @ 2024-02-24 2050/week @ 2024-03-02 6469/week @ 2024-03-09 4538/week @ 2024-03-16 4436/week @ 2024-03-23 2641/week @ 2024-03-30 2971/week @ 2024-04-06 3936/week @ 2024-04-13 2976/week @ 2024-04-20 2490/week @ 2024-04-27 2057/week @ 2024-05-04 937/week @ 2024-05-11

9,264 downloads per month
Used in 12 crates (10 directly)

MIT/Apache

180KB
4K 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

~7–13MB
~145K SLoC