Skip to content
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

Bevy 0.14 adds some very expensive debug assertions somewhere #14291

Open
SludgePhD opened this issue Jul 12, 2024 · 6 comments
Open

Bevy 0.14 adds some very expensive debug assertions somewhere #14291

SludgePhD opened this issue Jul 12, 2024 · 6 comments
Labels
C-Bug An unexpected or incorrect behavior C-Performance A change motivated by improving speed, memory usage or compile times S-Blocked This cannot move forward until something else changes

Comments

@SludgePhD
Copy link
Contributor

Bevy version

0.14.0

What you did

In bevy 0.13, my application runs at 60 FPS in a debug build with a Cargo profile override like this:

[profile.dev.package."*"]
opt-level = 3

In bevy 0.14, the same application struggles to hit 20 FPS with the same build configuration. Adding debug-assertions = false to the build config brings the lost performance back.

What went wrong

While debug assertions are often useful, these seem a bit too heavy to justify their inclusion (especially given that even all the checked arithmetic in the whole dependency tree doesn't destroy performance this badly).

This may be caused by wgpu, I have not investigated this issue.

@SludgePhD SludgePhD added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jul 12, 2024
@BD103 BD103 added C-Performance A change motivated by improving speed, memory usage or compile times S-Needs-Investigation This issue requires detective work to figure out what's going wrong labels Jul 12, 2024
@alice-i-cecile alice-i-cecile removed the S-Needs-Triage This issue needs to be labelled label Jul 14, 2024
@alice-i-cecile
Copy link
Member

We should fix this :) Bisecting or a minimal reproduction are the most useful next steps here.

@alice-i-cecile
Copy link
Member

According to gfx-rs/wgpu#5756, this looks to have been introduced in the wgpu 0.20 bump in #13186. Can you bisect before and after this?

@janhohenheim
Copy link
Member

@SludgePhD does the following line fix the issue?

[profile.dev.package.wgpu-types]
debug-assertions = false

@AyeTbk
Copy link

AyeTbk commented Jul 17, 2024

I noticed the same problem on my end, and applying @janhohenheim suggestion makes a massive difference (~60 FPS without it, ~460 FPS with it).

@SludgePhD
Copy link
Contributor Author

Yes, that fixes the issue

@janhohenheim
Copy link
Member

@cwfitzgerald just reopened the linked issue (thanks!)
Marking this as blocked since it's a WGPU problem.

@janhohenheim janhohenheim added S-Blocked This cannot move forward until something else changes and removed S-Needs-Investigation This issue requires detective work to figure out what's going wrong labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug An unexpected or incorrect behavior C-Performance A change motivated by improving speed, memory usage or compile times S-Blocked This cannot move forward until something else changes
Projects
None yet
Development

No branches or pull requests

5 participants