#profiler #gamedev #gui

puffin_egui

Show puffin profiler flamegraph in-game using egui

21 releases (breaking)

0.16.0 Jun 23, 2022
0.14.0 Apr 12, 2022
0.13.0 Feb 7, 2022
0.11.0 Nov 16, 2021
0.4.1 Jul 5, 2021

#35 in Profiling

Download history 93/week @ 2022-03-14 81/week @ 2022-03-21 53/week @ 2022-03-28 53/week @ 2022-04-04 107/week @ 2022-04-11 142/week @ 2022-04-18 175/week @ 2022-04-25 226/week @ 2022-05-02 152/week @ 2022-05-09 425/week @ 2022-05-16 158/week @ 2022-05-23 275/week @ 2022-05-30 125/week @ 2022-06-06 63/week @ 2022-06-13 119/week @ 2022-06-20 41/week @ 2022-06-27

438 downloads per month
Used in 4 crates

MIT/Apache

140KB
3K 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

~5–11MB
~187K SLoC