#profiler #gamedev

puffin_egui

Show puffin profiler flamegraph in-game using egui

36 releases (breaking)

0.29.0 Jul 31, 2024
0.27.0 Apr 6, 2024
0.26.0 Feb 14, 2024
0.24.0 Nov 24, 2023
0.4.1 Jul 5, 2021

#226 in Profiling

Download history 613/week @ 2024-08-26 600/week @ 2024-09-02 646/week @ 2024-09-09 525/week @ 2024-09-16 1124/week @ 2024-09-23 2677/week @ 2024-09-30 3355/week @ 2024-10-07 5686/week @ 2024-10-14 5380/week @ 2024-10-21 6709/week @ 2024-10-28 7576/week @ 2024-11-04 6866/week @ 2024-11-11 7166/week @ 2024-11-18 6611/week @ 2024-11-25 8224/week @ 2024-12-02 8961/week @ 2024-12-09

31,035 downloads per month
Used in 7 crates

MIT/Apache

195KB
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.

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

Dependencies

~7–13MB
~164K SLoC