Questions et réponses de la communauté

Bienvenue sur le forum de questions et réponses d'Audiokinetic, propulsé par la communauté. C'est l'endroit où les utilisateurs de Wwise et Strata s'entraident. Pour obtenir une aide directe de notre équipe, veuillez utiliser la page « Tickets de soutien ». Pour signaler un bug, utilisez l'option Bug Report dans l'Audiokinetic Launcher. (Veuillez noter que les rapports de bug soumis au forum questions-réponses seront rejetés. L'utilisation de notre système de rapport de bug dédié garantit que votre rapport est vu par les bonnes personnes et a les meilleures chances d'être corrigé.)

Pour obtenir rapidement les meilleures réponses, suivez ces conseils lorsque vous posez une question :

  • Soyez précis : qu'essayez-vous de réaliser ou quel est le problème spécifique que vous rencontrez ?
  • Pensez à inclure les détails importants : incluez des détails tels que les versions de Wwise et du moteur de jeu, le système d'exploitation, etc.
  • Expliquez ce que vous avez essayé de faire : indiquez aux autres les mesures que vous avez déjà prises pour essayer de résoudre le problème.
  • Concentrez-vous sur les faits : décrivez les aspects techniques de votre problème. Se concentrer sur le problème aide les autres personnes à trouver rapidement une solution.

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 = [
    '{3C874205-5335-4290-830F-A8BFF3AE8A6B}',
    '{AB619779-DBCA-455C-B1FA-3DA0D1BFEAF1}',
    '{D9391B7B-44F2-49E3-8756-9A592468BDAA}',
    '{5034CAD2-36B1-41F8-8249-CA8FBF8AD4AE}',
    '{BB5E4307-3363-43FD-B5FA-091526E189F2}',
    '{AB619779-DBCA-455C-B1FA-3DA0D1BFEAF1}',
    '{2A19ADA9-B6C0-4C4F-AD5A-E811629C83B5}',
    '{587FB8C3-591C-469F-87BF-7334E1821AB4}',
    '{AB9BBA39-26FD-4D6A-8A4F-C8FD6F3DCA89}',
    '{37B800E1-46C8-4DB3-AB5F-94C347246482}',
    '{DBFC4B0F-5772-47B6-A148-C51FF4CCD4A1}',
    '{7BC999C0-23E5-4890-A698-5D10150DA19B}',     
    .....
    # 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"]}
            }
            try:
                result = yield from self.call(WAAPI_URI.ak_wwise_core_object_get, **query)
            except Exception as err:
                # traceback.print_exc()
                pass
        self.leave()

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


def main():
    runner = ApplicationRunner(url=u"ws://127.0.0.1:8080/waapi", realm=u"realm1")
    try:
        runner.run(MyComponent)
    except Exception as e:
        pass


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?

 

UPDATE

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. 

 

 

dans Feature Requests par Beinan Li 李北南 (160 points)
edité par Beinan Li 李北南

Please sign-in or register to answer this question.

...