#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

#220 in Profiling

Download history 597/week @ 2024-08-14 504/week @ 2024-08-21 666/week @ 2024-08-28 510/week @ 2024-09-04 671/week @ 2024-09-11 722/week @ 2024-09-18 961/week @ 2024-09-25 3766/week @ 2024-10-02 4315/week @ 2024-10-09 5241/week @ 2024-10-16 6372/week @ 2024-10-23 6396/week @ 2024-10-30 7923/week @ 2024-11-06 6559/week @ 2024-11-13 7420/week @ 2024-11-20 6763/week @ 2024-11-27

29,907 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
~163K SLoC