Search Unity

Editor profile - get more info from FlushDirty

Discussion in 'Editor & General Support' started by theGreatSlutze, Aug 20, 2019.

  1. theGreatSlutze

    theGreatSlutze

    Joined:
    Jan 7, 2013
    Posts:
    25
    I've now had a few cases of the editor running very slowly, and when I try to go into the profiler and turn on the editor profiler, this is what I see:

    upload_2019-8-20_13-0-6.png

    I sort of understand what FlushDirty does, but mostly I'm confused because every function underneath it claims to be consuming 0.0% of the CPU. How can I find out what's actually causing the issue here?
     
  2. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    507
    Hi,

    Is this with enabled "Deep Profiler"? If yes, I think it is a case of not enough profiler markers in the FlushDirty code.
    Besides the deep profiler there is nothing you can do to get more information. I would recommend filing a bug that FlushDirty freezes the Editor.
    Generally I can see here 2 issues - 1) FlushDirty performance issue which blocks the Editor and impacts productivity and 2) Missing profiler markers which can help with understanding if this is a scripting code or not that causes spike
     
  3. ibbybn

    ibbybn

    Joined:
    Jan 6, 2017
    Posts:
    193
    I had an old script which caused this after updating to 2019.2.
    If it's like my problem you probably have "EditorUtility.SetDirty" called every frame somewhere. I've just added a save button and the problem is gone.
     
  4. Reahreic

    Reahreic

    Joined:
    Mar 23, 2011
    Posts:
    254
    Encountered this and wanted to add for future searchers another itemto check in addition to @ibbybn 's mention of Set Dirty.

    I had Scene View Handles that the user could move, that called Undo.RecordObject. This was fine when prefabs were small, but once they grew in size, or became nested within other large prefabs, considerable (+/-600ms) latency was introduced when dragging the handles.

    The solution here is to only store an undo point once the user ends their action instead of while the action is being performed.