Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

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:
    5,251
    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