Community Q&A

Where Wwise users help each other out!

Audiokinetic's Community Q&A is the forum where Wwise users ask and answer questions within the Wwise community. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

Bug(?): WAAPI low-level API slow only when called in SoundBank-generation steps

0 votes

Hello Wwise, 

I found a performance issue with WAAPI when making queries in SoundBank generation steps.

Test setup

  • Version: Wwise 2019.1.1
  • OS: Windows 10
  • Python: 3.7.3
  • Project: IntegrationDemo
  • Case: Query a list of GUIDs


import asyncio
import cProfile as profile
import logging
import os
from os.path import abspath, dirname, join
from pprint import pprint, pformat
import sys
import traceback

from autobahn.asyncio.wamp import ApplicationSession, ApplicationRunner

sys.path.append(abspath(join(os.environ['WWISEROOT'], 'SDK/include/AK/WwiseAuthoringAPI/py')))
from ak_autobahn import AkComponent
from waapi_uri import WAAPI_URI

_guids = [
    # total 105 GUIDs collected from the test project, cut short due to size limit of this post.

class MyComponent(AkComponent):
    def onJoin(self, details):
        for guid in _guids:
            query = {
                "from": {"id": [guid]},
                "options": {"return": ["id", "name", "type"]}
                result = yield from, **query)
            except Exception as err:
                # traceback.print_exc()

    def onDisconnect(self):
        # print("The client was disconnected.")

def main():
    runner = ApplicationRunner(url=u"ws://", realm=u"realm1")
    except Exception as e:

if __name__ == '__main__':
    profile.runctx('from __main__ import main; print(main())', globals(), locals())

With my setup, it takes less than 0.1 second to run through the script from a command prompt;

however, it takes around 10 seconds to finish the same script as a Global Closing Step.

From Python's instrumentation I fail to see an obvious bottleneck unfortunately. I had a few suspects but kinda ruled them out:

  1. buffered I/O: but even with non-buffered I/O (-u option of Python) and without all the prints, it still takes that long. 
  2. Python interpreter loading time: Having more queries in a bigger script that involves other computing tells me that it's still the query itself that takes long. 

It's almost like the async calls were blocked. Would you know if this is a known limitation?



New findings after a few tries

  1. The script runs at an expected speed with WwiseCLI from commandline. The slowdown only happens when generating banks in Wwise Authoring.
  2. In Wwise Authoring, the script runs slow even when using a separate thread and a new asyncio event loop in that thread. 



asked Jun 28, 2019 in Feature Requests by Beinan Li 李北南 (160 points)
edited Jul 5, 2019 by Beinan Li 李北南

Please sign-in or register to answer this question.