Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Profile game with Visual Studio

Discussion in 'Editor & General Support' started by UMSDev, Aug 17, 2022.

  1. UMSDev

    UMSDev

    Joined:
    Dec 17, 2017
    Posts:
    24
    Hello,

    I'm trying to run instrumentation profiler on my Unity build to know which functions are called the most and take the most time.

    I have created librairies in C# which are imported in Unity, I can debug them without problems but am not able to start the visual studio profiler to instrument them.

    I couldn't find an instrumentation function in Unity over a session. Or at least it seems to crash and I get many exceptions after a few minutes of running. (ThreadDeserializer should not parse more data once it has been marked as terminated)

    I have tried:

    • attach VS to Unity play mode but the instrumentation option isn't active
    • build in Unity with Debug options, PDB copied, deep profiling enabled, when trying to profile the .exe from Visual Studio I get
    Unable to obtain debugging information. PRF0002: The instrumentation with those options has failed

    • I also try to run my application .exe and attach VS's debugger but the instrumentation option is available.
    Am I missing something?

    Thank you for your help!
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,554
    To test performance in Unity you can simply use the profiler and even make extensions for the profiler to use for more clarity within functions