Facepunch / sbox-issues

176 stars 12 forks source link

Steam Audio has poor performance #5204

Closed the-remeko closed 3 weeks ago

the-remeko commented 6 months ago

Describe the bug

Playing sounds dramatically lowers FPS regardless of the geometry around them. Games that involve multiple guns shooting at a reasonable rate are heavily affected by this.

To Reproduce

Make a new scene without any physics objects and a component that plays a sound every .12 seconds. I have attached a repro project that does this. My FPS goes down by 26% when I toggle on the sound-playing component, and the scene is just a void. It's even worse in an actual game with visuals, physics, and even more sounds playing.

Expected behavior

Playing sounds should not tank FPS.

Media/Files

steamaudiolag.zip

Additional context

No response

garrynewman commented 6 months ago

What does the profiler look like when doing this?

Xenthio commented 6 months ago

image The performance graph looks like this, You can see the parts where the component where sounds are being played (yet again, every 0.12 seconds) is enabled and where it is not.

garrynewman commented 6 months ago

Yep that sucks, I assume it's going to be the occlusion tests