watson-developer-cloud / unity-sdk

:video_game: Unity SDK to use the IBM Watson services.
Apache License 2.0
569 stars 206 forks source link

Poor performance in ExampleStreaming.cs #611

Closed ryan-motive closed 4 years ago

ryan-motive commented 4 years ago

The RecordingHandler loop in ExampleStreaming.cs causes noticeable pauses in the app every time it runs. In particular, the array alloc is generating a lot of GC activity and the Max Level calculation is taking a measurable amount of time looking at each sample. On top of this, the Microphone API seems to just be slow (this is more of an observation, not directly related to this code). It's not really usable as-is. I'm in the process of reworking it, but has anyone successfully used this code in a deployment or are there other examples we should be using for deployed apps?

It seems like we'll need to tie directly into the native microphone code and push the stream straight to the service. Just wondering if anyone has done something like this already.

mamoonraja commented 4 years ago

@ryan-motive Thanks a lot for opening the issue, I will leave this one open to see if we get any response from developers who tried to optimize the example code. Some of the changes you mentioned are out of our control, and ExampleStreaming serves as a starting point.

rezasys2 commented 4 years ago

I have the same problem, this service is very slow, I hope someone finds a way or optimize the code soon.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. Thank you for your contributions.