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.
  2. The 2023.1 beta is now available for testing. To find out what's new, have a look at our 2023.1 feature highlights.
    Dismiss Notice

Deep Profiler is buggy.

Discussion in '5.4 Beta' started by laurentlavigne, Jul 23, 2016.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,790
    1. unusably slow: click in the profiler graph, which pauses the game, then expand the hierarchy overview a bit, it's almost unsable it's so slow. It's as if the profiler emulates how slow the game runs, depsite the fact that it's paused. #816971
    2. doesn't show name BeginSample("name") #816972
    3. Object: N/A regardless of the monobehavior being profiled, Object always shows as N/A, they're attached to GO, ya'know?
    These have existed since profiler has existed, time to fix that old code, fellas!
     
    Last edited: Jul 23, 2016
    MrEsquire likes this.
  2. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    yes this

    weird how its sooo much slower to move the slider onto a timeline area that took maybe 9,000ms (infact you can barely move the slider onto such a spike in calculations) while moving the slider onto over 100ms or less is doable.

    Its made using the deep profiler pointless, as it does seem like it emulates just how long something took.
     
    laurentlavigne likes this.
  3. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    473
    Hi,

    Thanks for reporting this, we are working on ProfilerWindow performance and general Profiler improvements at the moment.

    Deep profiler installs hooks into every mono method including managed UI itself. We have a prototype of deep-profiler alternative which installs hooks into only required subset of functions (namespace, assembly). Also TreeView itself got an upgrade. These improvements are targeting future releases.

    This is a known issue and will be fixed in future releases. We'll backport it to 5.4. (The bug's reason is that BeginSample call being wrapped by deep profiler immediately "ends" the sample when exiting the function, leaving only deep-profiler sample).

    Do you mean MonoBehaviour functions exposed by deep profiler? We do association with an object already when invoking "Update", "Awake", etc. standard calls.
     
    laurentlavigne likes this.
  4. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    473
    That happens because of profiling Profiler Window itself and lots of data to display. Profiler's overhead can be reduced if you disable profiler. Also we have a faster Timeline View (coming in 5.5) which can display much more samples than now.
     
    fffMalzbier likes this.
  5. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,790
    Backported to 5.4?
    Hooks into editor code as well?

    Can you explain further? I don't think we're talking about the same.
     
  6. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    473
    No, unfortunately not now. This is for later - targeting 5.5, it might be possible to backport UI improvements to 5.4, but these improvements are still in development and it will depend on amount of runtime changes.
    Yes, editor assemblies as well if you want to profile them. Basically we are making deep profiler configurable.
    I meant that we set an object then invoking "magic" methods of MonoBehaviour like Awake, Update, OnEnable, etc. You can see that e.g. under BehaviourUpdate node. But with deep profiler that information is lost because of bug #2, where injected into managed invocation sample ends native sample immediately and it gets discarded.
     
    laurentlavigne likes this.
  7. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,790
    Gotcha!

    Nice to hear you're working on it, I'm wondering, do you plan to extend the interaction - for example double click or right click on an overview entry opens the script at the position.
     
  8. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    For non bugs, I would consider backports a waste of Unity's time and only delays when we can get finals, so personally I'm not interested in backports unless bugfixes.
     
  9. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    "Also we have a faster Timeline View (coming in 5.5) which can display much more samples than now."

    I look forward to seeing those profiler improvements its definitely an area that gets used a lot and being able to use the deep profiler more often and it being faster would save time getting to the root problems quicker. Make it easier to export out that data and save/copy hierarchy snapshot would also help! I gave and saw plenty of suggestions in the profiler topic a while back.
     
  10. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,569
    More importantly, once 5.4 is out, the focus will be entirely on 'keep it stable so that people can ship games on it.' Every single change we make carries risk of unexpected side-effects, so we will be trying our best to restrict the changes only to fixes for issues that are shipstopping people or are causing a very high and widespread amount of pain...
     
  11. alexeyzakharov

    alexeyzakharov

    Unity Technologies

    Joined:
    Jul 2, 2014
    Posts:
    473
    We've collected and prioritized feedback in that thread. Thanks a lot for your input!
    We'll expose API to give access to profiler's data. Most of major profiler improvements are targeting 5.6 (UI improvements, streaming profiler, custom metadata with samples, profiler in non-dev players), some of them (UI performance fixes, expose internal counters) planned to be in 5.5.