kira icon indicating copy to clipboard operation
kira copied to clipboard

`StaticSoundData` is a performance footgun in debug mode

Open PatchMixolydic opened this issue 3 years ago • 3 comments

Using StaticSoundData when symphonia is built with opt-level = 0 can cause long audio processing times of up to twelve seconds. In an application that plays sound effects rapidly (such as a game that makes a sound every time you shoot or move), this is enough to fill the command queue. Ideally, until symphonia can be optimized, this limitation should be documented somewhere.

PatchMixolydic avatar Apr 16 '22 03:04 PatchMixolydic

Are you having long processing times when loading the StaticSoundData or every time you play it?

tesselode avatar Apr 16 '22 14:04 tesselode

It only seems to happen when loading the StaticSoundData (both from a Cursor<_> and from a file).

PatchMixolydic avatar Apr 16 '22 16:04 PatchMixolydic

I am seeing the same issue: very long delay for reasonably sized .mp3 files

The following Cargo.toml override is what worked for me:

[profile.dev.package.symphonia-bundle-mp3]
opt-level = 3

attackgoat avatar Apr 29 '22 15:04 attackgoat

I added an installation section to the book with information on setting the optimization level for dependencies.

tesselode avatar Nov 24 '22 22:11 tesselode