Search Unity

Profiler, which lines are editor related?

Discussion in 'Editor & General Support' started by LandHT, Jan 24, 2018.

  1. LandHT

    LandHT

    Joined:
    Feb 3, 2017
    Posts:
    84
    I'm starting to work on the performance of my game, and sometimes the profiler shows:
    • EditorOverhead
    • RenderTexture.SetActive (without having one)
    • Watermark
    • ...
    I can tell those are related to the editor itself, but it is there some sort of "list", or filter, that says which lines displayed in the profiler are related to editor? Cause some of them are hard to differenciate.

    I think this would be incredible useful, but i found nothing.
     
    Last edited: Jan 24, 2018
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,460
    Thanks for bringing it up. We're actually working on filtering the profiler output so it more cleanly separates this stuff. Part of that approach is about filtering EditorOnly safety allocations out from Hierarchy view (Reasoning: if you're scrubbing frames to get your player loop GC.Alloc free, you shouldn't see anything you don't have to do anything about) and de-emphasizing it in Timeline (i.e. grey it out, mark as EditorOnly, don't show child nodes. Reasoning: we can't hide time but we also want to emphasis the actionable stuff)

    Another thing we're looking at is to more clearly mark what happens in player loop over editor loop by adding root markers. This means an additional line in Timeline and an additional foldout in Hierarchy but we're looking to auto expand it in Hierarchy and the timeline view's vertical space issue is getting addressed so hopefully that extra line won't hurt too much. Especially since this would also be there when profiling a player build.

    All the Editor Only stuff that we'd hide/collaps would become available as soon as you hit "Profile Editor" in case you're working on Asset Store Packages

    I'm interested to hear what you think of this and if that would help you.

    Regarding your markers, Watermark probably is the "DevelopementBuild" text in the lower right corner of the screen. EditorOverhead might be rendering Editor UI and logic or just generally time that is unaccounted for while profiling the player loop within the editor.

    Even with our filtering, the cleanest profiling you can get is still from profiling a player build instead of the editor though, as there is always going to be stuff that interferes while profiling the editor.
     
    LandHT likes this.
  3. LandHT

    LandHT

    Joined:
    Feb 3, 2017
    Posts:
    84
    I can't see any inconvenient with something like this being implemented.

    Definitely would help. Appreciate it.
     
  4. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    Ultimately, you should profile your game on the target hardware and not in the editor. The performance characteristics of the game running in the editor and a build are very often significantly different.

    Here is a quote from Unity staff:
     
    LandHT likes this.
  5. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,460
    Right, I should've been more specific when I said player builds. While profiling a standalone Win/Mac build gets rid of all the editor overhead, there are obviously still OS and hardware specific gotchas. Like a mobile phone OS throttling CPU if the phone overheats.
    To maybe sacrifice those shiny 60 fps so that the phone will stay colder and the performance more stable is not the most intuitive thing, especially if you're not profiling on device.
     
  6. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,460
    Just a small update on this, from 2018.3 on, the Profiler toplevel markers are in. The player running within the Editor is underneath the PlayerLoop sample and the Editor related stuff under Editor Loop. When "Profile Editor" is active, everything is underneath the EditorLoop sample.

    Samples that only occur in the Editor (e.g. safety checks) will show up as "EditorOnly [SomeMethodName]" and their GC value will be shown but not added to that of the encompassing sample. Also, any samples underneath those will be hidden, including the GC.Alloc. If you want to see those, there's an option menu in the CPU Hierarchy view toolbar to toggle the collapsing of these samples.


    Note that in the above, the surrounding GC Alloc values don't seem to change because the error logs for this particular EditorOnly sample are so heavy in GC Allocs, that the collapsed 64B get lost to the rounding in the UI (Player loop is the only place where it does show).
     
    Rewaken, LandHT and Peter77 like this.
  7. LandHT

    LandHT

    Joined:
    Feb 3, 2017
    Posts:
    84
    Thanks Martin and everyone related to the work.
     
    MartinTilo likes this.
  8. daniozi117

    daniozi117

    Joined:
    Mar 4, 2016
    Posts:
    27
    I am using Unity2018.3.2f1 on Mac Mojave.
    FPS 75 tp 345,
    tries 66k, vertices101.2k
    batches141
    Set Pass Call 116, Draw Call 214 batched draw calls 129 batches 41

    crash on Samsung 5s. Editor loop take unto 80 percent sometimes. code is optimise.
     
  9. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,460
    Hi @daniozi117,
    I don't see how this relates to the thread but please do submit a bug report with an editor.log and crashlog and details on how to reproduce the crash. See this for more details on how to submit a bug report: https://unity3d.com/unity/qa/bug-reporting

    Thank you :)