开发者

OpenAL: alcOpenDevice() slow, can it be speed up?

开发者 https://www.devze.com 2023-03-06 10:34 出处:网络
Is it normal to take up to 2 seconds to run this function? It takes about 0.5 to 2.5 seconds, rarely more than 1 second though, usually around 开发者_Go百科0.6 to 0.9 seconds.

Is it normal to take up to 2 seconds to run this function? It takes about 0.5 to 2.5 seconds, rarely more than 1 second though, usually around 开发者_Go百科0.6 to 0.9 seconds.

Just wondering, if i could speed this up somehow, perhaps remembering the device name from the first run or something?


These methods are usually slow since they're probably handling the initialization of the device, etc.

My guess is that this method is slow mostly because of the operating system.

The usual workarounds these types of methods is doing them asynchronously (in a background thread) and displaying a "Loading" text/image. You should also cache the pointer that alcOpenDevice() returns too so you don't pay the price of calling it over and over again.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号