#profiler #gamedev #gui

puffin_egui

Show puffin profiler flamegraph in-game using egui

9 releases (breaking)

0.8.0 Sep 20, 2021
0.7.0 Sep 6, 2021
0.6.0 Aug 25, 2021
0.5.0 Aug 23, 2021
0.1.0 May 6, 2021

#44 in Profiling

Download history 15/week @ 2021-06-07 23/week @ 2021-06-14 35/week @ 2021-06-21 29/week @ 2021-06-28 70/week @ 2021-07-05 46/week @ 2021-07-12 39/week @ 2021-07-19 73/week @ 2021-07-26 90/week @ 2021-08-02 135/week @ 2021-08-09 19/week @ 2021-08-16 77/week @ 2021-08-23 45/week @ 2021-08-30 46/week @ 2021-09-06 160/week @ 2021-09-13 100/week @ 2021-09-20

288 downloads per month
Used in 2 crates

MIT/Apache

42KB
1K 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, and immediate mode GUI library, using 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

~3MB
~49K SLoC