Search Unity

[Suggestions] Range selection support for Unity Profiler

Discussion in 'Editor & General Support' started by YoungXi, Aug 28, 2019.

  1. YoungXi

    YoungXi

    Joined:
    Jun 5, 2013
    Posts:
    63
    upload_2019-8-28_16-31-29.png

    Currently Unity Profiler can only select one specific frame, but sometimes we need to measure average time costs in a range of frames.

    So I strongly suggest that you guys can add range selection support for Unity Profiler.
    (Ignore me if this is already supported...)
     
    MartinTilo and alexeyzakharov like this.
  2. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    508
    Thank you for the feedback! Frame range selection is not yet supported in the Profiler Window, but we are considering adding it. We are collecting use cases and analyzing workflows to ensure we get it right. Thus
    Could you please describe your use case and which decisions this would help you to make.

    (Not to sidetrack you, but I have to mention that there is a tool in a package form which does analysis of profiler data - https://docs.unity3d.com/Packages/c...yzer@0.4/manual/profiler-analyzer-window.html)
     
    YoungXi and MartinTilo like this.
  3. YoungXi

    YoungXi

    Joined:
    Jun 5, 2013
    Posts:
    63
    Hi, thanks for the reply. My use case is simple.
    I wanted to measure the UGUI scrolling efficiency using Mask and RectMask2D. It's something you can't measure within one frame.
    For other cases, like profiling Update costs, we have added custom profiling codes to get the avg cost.
    But wouldn't it be nicer to have it built-in with Unity.
     
    mannyhams and alexeyzakharov like this.
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,461
    How did you achieve that? Did you mark the code with ProfilerMarker and record the timings with Recorder?
    Also, what Problem where you trying to solve that way? Did you just want the average cost per component update to see the cost? To monitor them over time? Within one run or across multiple runs and throughout development? Did you have budgets they where supposed to stay in? Do you have CI tooling around this?

    For the UGUI Scrolling case, do you have one single sample that you would look at to compare the efficiency averaged out over a range of frames? Would you need to see the hierarchical samples underneath it also averaged?

    I agree that this should be something that's solved within Unity and also within the Profiler Window in some way. For the interim time, it sounds like Profile Analyzer would be ideal for this, as it would also allow you to see other knock-on effects besides the samples you're monitoring, though it will really preserve the hierarchical structure surrounding the samples. Unless that is actually what you'd need from this.

    Still, even if Profile Analyzer would solve the immediate need, your answers to the questions above would help us validate what expected workflows and problems we'd nee to solve for going forward :)
     
  5. YoungXi

    YoungXi

    Joined:
    Jun 5, 2013
    Posts:
    63
    1. We wrote our custom profiling codes to get a Methods avg cost(Well, our custom profiling codes is not just for this case.).
    2. In the actually performance test, our QA team use other profiling tools to get a list of calls which have a higher total cost and also avg cost. But as developer, I would like to see those results in the Editor, not after the build and using other profiling tools to get the results.
    3. For the scrolling case, actually I just need the avg cpu cost. But it would be nice if Unity gives the call hierarchies that take the most cpu time in the selected range.
    4. What would be more useful is to get the avg cost of each job within a period of time.

    Basically, I just want immediate feedbacks inside Unity after I make any optimizations, not after build using XCode instruments or other tools. And some optimizations must be measured using total cost and avg cost.

    I didn't know there's a Profile Analyzer tool, so I'm gonna try it out first. Thanks again.
     
    mannyhams and alexeyzakharov like this.
  6. firthm01

    firthm01

    Joined:
    Jan 21, 2020
    Posts:
    3
    This would be really useful - I just was trying to do this myself

    +1 from me
     
    mannyhams likes this.
  7. farshidhss2

    farshidhss2

    Joined:
    Sep 19, 2019
    Posts:
    6
    We have a simple use case where we lazily load several files. The method itself will be called on the span of several frames and it's very important for us to know how much time it took in total to load all data over about 100 frames. With the current profiler we can't do that.