Search Unity

Is it normal for there to be a 1300ms hangtime when first drawing inspectors after assembly reload?

Discussion in 'Editor & General Support' started by pastaluego, Nov 8, 2018.

  1. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    196
    After any assembly reload (after compilation or when entering playmode) if I click on a gameobject in the scene with any serialized attribute, there's a ~1300ms call to InspectorWindow.DrawEditors(). Whether it's in a project with hundreds of custom editor scripts or an empty project with a single script with a single serialized integer.

    The only thing I could find, was that this only happens with .NET 4.x runtime, where it's only ~300ms with .NET 3.5.

    The only discrepancy between the two I could find when deep profiling the editor was that the ScriptAttributeUtility.BuildDrawerTypeForTypeDictionary does:

    RuntimeType.GetBaseType()
    > Type.get_IsInterface()
    > string.memset()

    that have calls in the millions. Not sure why 3.5 doesn't have them, but that's the only difference I could find, and the above takes up the majority of the 1300ms.

    Basically yeah is this normal for there to be such a hangtime when loading inspector for the first time in 4.x but not 3.5?
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    This is probably a bug. You should report it using the bug reporter!

    You could also post it in the experimental scripting preview forum. While 4.x isn't experimental anymore, that is where you find most Unity employees connected to the runtime version.
     
  3. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    196
    Thanks I will do both of those.