bevyengine / bevyengine/bevy

Vulkan perf regression: 0.13 to 0.14: 3-4 times higher CPU usage in empty project with DefaultPlugins due to wgpu 0.20

Open
#14,227 12 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug C-Performance I-Regression S-Blocked
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version

* Original: 0.13
* Current: 0.14

## Relevant system information

Ubuntu 22.04 X11
AMD Ryzen 7 3700x 8-core processor
cargo 1.79.0 (ffa9cf99a 2024-06-03)

bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3070", vendor: 4318, device: 9348, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "550.90.07", backend: Vulkan }
system{name="bevy_diagnostic::system_information_diagnostics_plugin::internal::log_system_info"}: bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux 22.04 Ubuntu", kernel: "6.5.0-41-generic", cpu: "AMD Ryzen 7 3700X 8-Core Processor", core_count: "8", memory: "31.3 GiB" }

## What's performing poorly?

I noticed my fans were spinning up on Bevy 0.14. I went into htop and saw that an app with only `DefaultPlugins` was using up to 7.5% CPU in Irix Mode Off (with Irix Mode On it was using ~130%). 0.13 on the other hand is only topping out at 2.2% with a similar setup. So 0.14 is using up ~3.5 times as many CPU resources.

## Before and After Traces

Tried to zoom in as much as possible on these. I cannot tell much of a difference. The common parts are all very similar. CPU usage with Tracy was much more similar to each other (140% vs 200% with Irix Mode On). Top one is before.

![image](https://github.com/bevyengine/bevy/assets/16760830/5d45d4b4-bad1-457b-af4b-7157efea10f6)
![image](https://github.com/bevyengine/bevy/assets/16760830/924b4378-ca52-4fef-88f2-0fb157386706)

## Additional information

I originally ran with the nightly and the "fast compile" settings. The behavior was the same there.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the CPU usage difference in an empty project using DefaultPlugins on Vulkan, comparing Bevy 0.13 and 0.14 with wgpu 0.20. Inspect the bevy_render::renderer path and the supplied Tracy traces to identify the regression. Done means isolating and fixing the cause, then verifying that CPU usage returns near the 0.13 baseline.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.