bevyengine / bevyengine/bevy

Periodic drops in fps

Open
#18,050 8 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug C-Performance S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version
Version `0.15.3`, with features: [`"animation", "bevy_animation", "bevy_asset", "bevy_audio", "bevy_color", "bevy_core_pipeline", "bevy_gilrs", "bevy_gizmos", "bevy_gltf", "bevy_mesh_picking_backend", "bevy_pbr", "bevy_picking", "bevy_render", "bevy_scene", "bevy_sprite", "bevy_sprite_picking_backend", "bevy_state", "bevy_text", "bevy_ui", "bevy_ui_picking_backend", "bevy_window", "bevy_winit", "default_font", "multi_threaded", "smaa_luts", "sysinfo_plugin", "tonemapping_luts", "x11", "qoi", "shader_format_spirv"`]
(I have seen this happen with default features too)
Edit: this even happens with the minimum features:
```toml
bevy = { version = "0.15.3", default-features = false, features = ["default_font", "bevy_winit", "wayland"] }
iyes_perf_ui = { version = "0.4.0", default-features = false, features = ["entries"]}
```

## What you did

Write a simply app that uses iyes_perf_ui to observe fps.
Code:
```rs
use bevy::{diagnostic::FrameTimeDiagnosticsPlugin, prelude::*, render::diagnostic::RenderDiagnosticsPlugin};
use iyes_perf_ui::{entries::PerfUiFramerateEntries, PerfUiPlugin};

fn main() -> AppExit {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(FrameTimeDiagnosticsPlugin)
.add_plugins(bevy::diagnostic::EntityCountDiagnosticsPlugin)
.add_plugins(bevy::diagnostic::SystemInformationDiagnosticsPlugin)
.add_plugins(RenderDiagnosticsPlugin)
.add_plugins(PerfUiPlugin)
.add_systems(Startup, init)
.run()
}

fn init(mut commands: Commands) {
commands.spawn(Camera2d);
commands.spawn(PerfUiFramerateEntries::default());
}
```

## What went wrong

Every so often fps drop drastically for some (fairly short) period of time.
This can be observed in `iyes_perf_ui` by looking at the `FPS (min)` and `Frame Time (max)` values.

## Additional information

Video: https://github.com/user-attachments/assets/8ae90b2f-8768-454e-a33a-0ff224e1c422
Ran using `cargo run --release`
`log` and `tracing` crates set to `"max_level_info", "release_max_level_warn"`

Contributor guide

Open the contributing guide

Research direction

Start with the minimal Bevy application in the issue, including `main`, `init`, `PerfUiPlugin`, and the diagnostic plugins, and reproduce it with `cargo run --release`. Compare the full-feature and minimum-feature configurations, then trace the periodic frame-time spikes from the reported FPS and frame-time values. Done means the cause is identified and the periodic drops are prevented or clearly characterized.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.