UnityPlugin-AVProVideo icon indicating copy to clipboard operation
UnityPlugin-AVProVideo copied to clipboard

[Enhancement] Resolve Project Auditor issues

Open blaine-grady-poppulo opened this issue 8 months ago • 2 comments

Which platform is your feature request for?

No response

Description

I am using AVPro Video Ultra version 3.2.6 in Unity 6000.0.31f with the Project Auditor 1.0.1 package (https://docs.unity3d.com/Packages/[email protected]/manual/index.html). It is recommended to install the package and run the analysis.

The Project Auditor is flagging a number of issues in the AVProVideo assemblies. Attached are the issues for the Windows platform. Can as many issues be resolved as possible to improve the performance?

Image

blaine-grady-poppulo avatar May 28 '25 16:05 blaine-grady-poppulo

What issues are you having with performance?

Chris-RH avatar May 29 '25 12:05 Chris-RH

I am not seeing any performance issues. I just saw these issues when I was analyzing my project. I created the ticket just to ask if any of the recommended changes can be made to improve performance in general. Thanks.

blaine-grady-poppulo avatar May 29 '25 12:05 blaine-grady-poppulo

Hi @blain-grady-poppulo

Thank you for pointing this out to us. We have spent some time going over the suggested performance optimisations shown by this package and performed our own profiling and found that we mostly adhere to the suggestions in that we limit these high cost functions to only run when necessary. As such this plugin will continue to show some of these warnings as most are unavoidable or necessary to achieve the desired functionality.

Looking more specifically at some of the recommendations. One of the major severity issues is the use of Camera.allCameras within UpdateMultiPassStereo.cs, and whilst this is good advice in general that Camera.GetAllCameras should be used with a cached list of cameras, for our use case this does not make sense as we only need to perform this once, and only if Camera.main fails. Through our testing we found that Camera.allCameras beat out Camera.GetAllCameras, that is when you don't cache the list of cameras.

Image

Looking through, we can also see that the majority of the Major Severity threats are Boxing allocations, none of which are running consistently, and the majority are from the various demos we provide. Others originate from our Helper class which has several helper functions that return data as formatted string. We also try to provided detailed logging when things go awry, which also appear as Major Severity.

If you have any specific performance issues then please feel free to open a new issue and we will investigate.

Reuben-RH avatar Jul 03 '25 09:07 Reuben-RH