#profiler #gamedev

puffin_egui

Show puffin profiler flamegraph in-game using egui

35 releases (breaking)

0.27.1 Jun 16, 2024
0.26.0 Feb 14, 2024
0.24.0 Nov 24, 2023
0.22.0 May 24, 2023
0.4.1 Jul 5, 2021

#94 in Profiling

Download history 4360/week @ 2024-03-15 5414/week @ 2024-03-22 2494/week @ 2024-03-29 2947/week @ 2024-04-05 3494/week @ 2024-04-12 3470/week @ 2024-04-19 2539/week @ 2024-04-26 2127/week @ 2024-05-03 920/week @ 2024-05-10 2075/week @ 2024-05-17 1976/week @ 2024-05-24 2877/week @ 2024-05-31 4024/week @ 2024-06-07 4061/week @ 2024-06-14 2573/week @ 2024-06-21 1466/week @ 2024-06-28

12,563 downloads per month
Used in 10 crates (8 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
~147K SLoC