| Crates.io | iyes_perf_ui |
| lib.rs | iyes_perf_ui |
| version | 0.5.0 |
| created_at | 2024-03-19 19:16:12.45533+00 |
| updated_at | 2025-05-20 12:19:31.605889+00 |
| description | Customizable Performance/Debug Overlay for Bevy UI |
| homepage | https://github.com/IyesGames/iyes_perf_ui |
| repository | https://github.com/IyesGames/iyes_perf_ui |
| max_upload_size | |
| id | 1179569 |
| size | 312,911 |
Sponsor me:
Bevy Compatibility:
| Bevy Version | Plugin Version |
|---|---|
0.16 |
0.5 |
0.15 |
0.4 |
0.14 |
0.3 |
0.13 |
0.2,0.1 |
This crate provides an implementation of an in-game performance/debug UI overlay for the Bevy game engine.
The goal of this crate is to make it as useful as possible for any Bevy project:
simple example)specific_entries example):
custom_minimal and custom examples)settings, fps_minimalist examples)First, make sure to add the plugin to your app:
app.add_plugins(PerfUiPlugin);
And then, spawning a Perf UI can be as simple as:
commands.spawn(PerfUiDefaultEntries::default());
This creates a Perf UI with a curated selection of entries, which are, in my opinion, the most useful out of everything provided in this crate.
If you want a UI with all the available entries (note: may have significant performance overhead):
commands.spawn(PerfUiAllEntries::default());
If you want to create a Perf UI with specific entries of your choice, just spawn an entity with the components representing your desired entries, instead of using the above bundles.
commands.spawn((
PerfUiEntryFPS::default(),
PerfUiEntryClock::default(),
// ...
));
There are also some bundles to help you add some common groups of entries:
commands.spawn((
// Contains everything related to FPS and frame time
PerfUiFramerateEntries::default(),
// Contains everything related to the window and cursor
PerfUiWindowEntries::default(),
// Contains everything related to system diagnostics (CPU, RAM)
PerfUiSystemEntries::default(),
// Contains everything related to fixed timestep
PerfUiFixedTimeEntries::default(),
// ...
));
If you want to customize the appearance, set the various fields in each of
the structs, instead of using default(). To customize settings that apply
to all entries, add the PerfUiRoot component.
NOTE: if you disable Bevy's built-in default font, you must specify the
fonts that you would like to use, by customizing PerfUiRoot.


It is possible to visualize the value in other ways, not just display it as text.
iyes_perf_ui currently provides one such widget implementation: Bar. To
use it, wrap your entries in PerfUiWidgetBar.
For example, to display FPS as a Bar:
commands.spawn((
PerfUiRoot::default(),
PerfUiWidgetBar::new(PerfUiEntryFPS::default()),
// ...
));
If you want to create your own custom widgets, have a look at implementing
the PerfUiWidget trait.
Displaying the Perf UI might add non-negligible overhead to your app, depending on configuration. The overhead can be reduced by spawning a simpler UI with fewer entries.
Just keep this in mind. Your game will run slightly faster when the Perf UI is not being displayed. This crate is designed to eliminate all perf overhead when the UI is not rendered on-screen.
A "full" UI with all the entries offered by this crate can add a few hundred
microseconds of frame time on typical gaming hardware, most of which is CPU
time spent in Bevy's UI layout systems (in PostUpdate).
I am looking for ways to optimize this crate to reduce its overhead.