Search Unity

Profiler.CollectAudioStats?

Discussion in 'Editor & General Support' started by ryanmillerca, Apr 29, 2020.

  1. ryanmillerca

    ryanmillerca

    Joined:
    Aug 12, 2012
    Posts:
    143
    Hi there, I'm doing some performance testing on a game using the Profiler (Unity 2018.4) and noticed that Profiler.CollectAudioStats was taking an awfully long time each frame (20ms on average). I know the Profiler tends to have a fair bit of overhead, but 20ms of the total 35ms CPU time seems excessive - especially for audio profiling! I'm profiling remotely through a development build and the Unity Editor Profiler window.

    I'm wondering if anyone has seen this before and can comment on why this is happening and how I might prevent it from happening (other than turning the profiler off entirely). 35ms of CPU usage in the profiler makes each frame miss it's vsync and is making the numbers harder to sift through.

    Thanks
    -Ryan
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,455
    you could close the Audio Profiler Module or call Profiler.SetAreaEnabled(ProfilerArea.Audio, false); (on the player side)
    The Audio module can be quite heavy, depending on the audio usage in your project. It's actually the reason why we added the ability to close a module and then have the profiler no longer collect stats for that module. (that was added in 2018.3)
     
  3. ryanmillerca

    ryanmillerca

    Joined:
    Aug 12, 2012
    Posts:
    143
    Thanks!
     
    MartinTilo likes this.