emscripten-core / emscripten-core/emscripten
OpenAL updateSourceSpace performance issue
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
Hi.
I'm using emscripten 3.0.1 to compile my game and I use the OpenAL implementation for audio.
I update a bunch of sources and the listener every frame and I noticed that the performance of my game would drastically decrease over time. I tracked down the issue using Google Chrome's profiler and noticed that it was coming from the [updateSourceSpace](https://github.com/emscripten-core/emscripten/blob/8e1e305519e1027726a48861a1fec5662f7e18a2/src/library_openal.js#L508).
I went a little further analyzing the issue and realized that it was more precisely coming from the updating of the panner's property ([here](https://github.com/emscripten-core/emscripten/blob/8e1e305519e1027726a48861a1fec5662f7e18a2/src/library_openal.js#L612) for instance). I edited the library_openal.js to comment out those lines and I noticed no performance issue. I also compiled using OPENAL_DEBUG, no warning or errors.
In addition, I made sure that the problem wasn't coming from a ridiculous amount of audio sources, it's not the case, I have a bunch of sources and this number does not increase.
I'd be glad to look into it further but I'm kind of stuck at this point. Does this issue ring a bell to anyone? could someone point me in a direction so I can keep investigating?
EDIT: Something else I noticed, it's a bit hard to put into words: it seems that when my simulation performance starts deteriorating, playing sounds will make it go back up like it cleared some hanging state or something...
Thank you very much!
Nathan.
Contributor guide
Assessment
This issue has not been assessed yet.