#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

#109 in Profiling

Download history 1289/week @ 2024-01-01 2374/week @ 2024-01-08 2574/week @ 2024-01-15 2729/week @ 2024-01-22 2726/week @ 2024-01-29 2855/week @ 2024-02-05 1720/week @ 2024-02-12 1838/week @ 2024-02-19 1973/week @ 2024-02-26 1998/week @ 2024-03-04 6580/week @ 2024-03-11 4656/week @ 2024-03-18 4277/week @ 2024-03-25 2852/week @ 2024-04-01 2820/week @ 2024-04-08 3686/week @ 2024-04-15

13,867 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–14MB
~141K SLoC