Search Unity

Does Profiler support methods view (to view "hottest" methods)?

Discussion in 'Editor & General Support' started by Radik-Salakhov, Aug 6, 2017.

  1. Radik-Salakhov

    Radik-Salakhov

    Joined:
    Nov 16, 2014
    Posts:
    16
    All Profilers I used so far support not only "Hierarchy View", but also "Methods View". It is basically a list of methods sorted by theirs execution time.
    "Methods View" is very usefull because it can show often called methods. A method self can be very fast and thus hard to find in "hierarchy view". But total amount of time spent in this method can be high if it is called many times from many different places.

    If Unity Profiler doesn't support it, maybe there is a plugin which takes profiler dump and build list of "hottest" methods?

    Thanks.
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You can add your own profiler start and stop. See docs.
     
  3. Radik-Salakhov

    Radik-Salakhov

    Joined:
    Nov 16, 2014
    Posts:
    16
    Could you be more specific?
    Do you mean "BeginSample" and "EndSample" methods? If so, then it is not a solution I am looking for. They are still are shown in the hierarchy view.
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I'd suggest you do your own benchmark for the method that concerns you. You sound smart so I guess you already did. I don't think the profiler suits your specific need. I just pause it and scrub to the data I require if things move around a lot.
     
  5. Dreamback

    Dreamback

    Joined:
    Jul 29, 2016
    Posts:
    220
    Maybe I’m not understanding, but that sounds like pretty much what the profiler does. Do a Deep Profile, and it lists what takes the most execution time per frame, in order, even if it’s just one fast function being called a million times. It even lists how often that file was called that frame.
     
  6. Radik-Salakhov

    Radik-Salakhov

    Joined:
    Nov 16, 2014
    Posts:
    16
    It is true if this fast method is called from one place. If this method (lets say "GetHashCode") is called from many different places then you have to expand all tree branches in "hierarchy view" to see them all. What I want is to have a list where only one record "GetHashCode" which shows how many times this method was called per frame (from all the places places).
    There is such feature in "dotTrace" profiler. It is called "Hot Spots".
    Just compare (see attached pictures):
    - "Call Tree View" (it is the same as "Hierarch View" in Unity)
    - "Hot Spots" (it is a reversed tree, where simplest methods like "GetHashCode" are shown first)
     

    Attached Files:

  7. slippyfrog

    slippyfrog

    Joined:
    Jan 18, 2016
    Posts:
    42
    a436t4ataf and MartinTilo like this.