#profiler #gamedev

puffin_egui

Show puffin profiler flamegraph in-game using egui

34 releases (breaking)

0.27.0 Apr 6, 2024
0.26.0 Feb 14, 2024
0.25.0 Jan 17, 2024
0.24.0 Nov 24, 2023
0.4.1 Jul 5, 2021

#80 in Profiling

Download history 2720/week @ 2024-01-23 2773/week @ 2024-01-30 2705/week @ 2024-02-06 1681/week @ 2024-02-13 1806/week @ 2024-02-20 2071/week @ 2024-02-27 2387/week @ 2024-03-05 6647/week @ 2024-03-12 4765/week @ 2024-03-19 3506/week @ 2024-03-26 3120/week @ 2024-04-02 3060/week @ 2024-04-09 3999/week @ 2024-04-16 2718/week @ 2024-04-23 2346/week @ 2024-04-30 1685/week @ 2024-05-07

11,387 downloads per month
Used in 11 crates (9 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
~144K SLoC