-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SystemInformationDiagnosticsPlugin is slow due to sysinfo
crate
#12848
Comments
Any indication if this is an upstream problem, versus something that Bevy is doing wrong? Is this just latency, or is there real work being done? |
For the CPU usage there seems to be a Other than that I could not find information on how costly the refresh calls are. It might make sense to do the refreshes/measurements on an AsyncCompute task, so it does not block the frames. |
I ran into this today so here's the tracy graph I was looking at. Enabling the plugin can drop fps to 30 or less, while disabling the plugin lets this particular app run at 200+ fps.
|
sysinfo
crate
# Objective Reading system information severely slows down the update loop. Fixes #12848. ## Solution Read system info in a separate thread. ## Testing - Open the scene 3d example - Add `FrameTimeDiagnosticsPlugin`, `SystemInformationDiagnosticsPlugin` and `LogDiagnosticsPlugin` to the app. - Add this system to the update schedule to disable Vsync on the main window ```rust fn change_window_mode(mut windows: Query<&mut Window, Added<Window>>) { for mut window in &mut windows { window.present_mode = PresentMode::AutoNoVsync; } } ``` - Read the fps values in the console before and after this PR. On my PC I went from around 50 fps to around 1150 fps. --- ## Changelog ### Changed - The `SystemInformationDiagnosticsPlugin` now reads system data separate of the update cycle. ### Added - The `EXPECTED_SYSTEM_INFORMATION_INTERVAL` constant which defines how often we read system diagnostic data. --------- Co-authored-by: IceSentry <[email protected]>
Reading system information severely slows down the update loop. Fixes #12848. Read system info in a separate thread. - Open the scene 3d example - Add `FrameTimeDiagnosticsPlugin`, `SystemInformationDiagnosticsPlugin` and `LogDiagnosticsPlugin` to the app. - Add this system to the update schedule to disable Vsync on the main window ```rust fn change_window_mode(mut windows: Query<&mut Window, Added<Window>>) { for mut window in &mut windows { window.present_mode = PresentMode::AutoNoVsync; } } ``` - Read the fps values in the console before and after this PR. On my PC I went from around 50 fps to around 1150 fps. --- - The `SystemInformationDiagnosticsPlugin` now reads system data separate of the update cycle. - The `EXPECTED_SYSTEM_INFORMATION_INTERVAL` constant which defines how often we read system diagnostic data. --------- Co-authored-by: IceSentry <[email protected]>
Bevy version
0.13.1
Relevant system information
What you did
Add the
bevy::diagnostic::SystemInformationDiagnosticsPlugin
plugin.What went wrong
The
diagnostic_system
of theSystemInformationDiagnosticsPlugin
takes around 4ms on my system, which makes it unsuitable to use while measuring performance.Additional information
Noticed this, as I used this with
iyes_perf_ui
and could not get more than 200FPS.The text was updated successfully, but these errors were encountered: