egui/examples/puffin_profiler
Ted de Munnik 3af907919b
Use `profiling` crate to support more profiler backends (#5150)
Hey! I am not sure if this is something that's been considered before
and decided against (I couldn't find any PR's or issues).

This change removes the internal profiling macros in library crates and
the `puffin` feature and replaces it with similar functions in the
[profiling](https://github.com/aclysma/profiling) crate. This crate
provides a layer of abstraction over various profiler instrumentation
crates and allows library users to pick their favorite (supported)
profiler.

An additional benefit for puffin users is that dependencies of egui are
included in the instrumentation output too (mainly wgpu which uses the
profiling crate), so more details might be available when profiling.

A breaking change is that instead of using the `puffin` feature on egui,
users that want to profile the crate with puffin instead have to enable
the `profile-with-puffin` feature on the profiling crate. Similarly they
could instead choose to use `profile-with-tracy` etc.

I tried to add a 'tracy' feature to egui_demo_app in order to showcase ,
however the /scripts/check.sh currently breaks on mutually exclusive
features (which this introduces), so I decided against including it for
the initial PR. I'm happy to iterate more on this if there is interest
in taking this PR though.

Screenshot showing the additional info for wgpu now available when using
puffin

![image](https://github.com/user-attachments/assets/49fc0e7e-8f88-40cb-a69e-74ca2e3f90f3)
2024-12-16 09:15:54 +01:00
..
src Use `log` crate instead of `eprintln` & remove some unwraps (#5010) 2024-09-13 14:23:13 +02:00
Cargo.toml Use `profiling` crate to support more profiler backends (#5150) 2024-12-16 09:15:54 +01:00
README.md Automatically generate screenshots for all examples (#2379) 2022-12-04 17:27:40 +01:00
screenshot.png Move all existing .png images to git LGS (#5320) 2024-10-29 10:04:07 +01:00

README.md

Example how to use the puffin profiler with an eframe app.

cargo run -p puffin_profiler &

cargo install puffin_viewer
puffin_viewer --url 127.0.0.1:8585