Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

C# Compiler Suggestion: Don't Reload Domains when IL is Unchanged

Discussion in 'Experimental Scripting Previews' started by JohnAustinPontoco, Apr 6, 2020.

  1. JohnAustinPontoco

    JohnAustinPontoco

    Joined:
    Dec 23, 2013
    Posts:
    283
    Very often while waiting for the domain to reload, I'll notice a stray comment, fix formatting, or generally cleanup the code I just wrote. Naturally, this triggers another domain reload, which is frustrating. I have to be very careful not to touch C# files too often.

    However, in many cases the generated IL hasn't changed, and we shouldn't need to perform a domain reload in these cases. I would guess that caching the IL and performing this check would cut out about 20% of the domain reloads I wait through in normal development.

    The downside is that you would no longer be able to force a domain reload by changing whitespace in a file (for debugging). Realistically, though, it's more sensible to address this need with some sort of dedicated 'reload domains' button in the menus.
     
  2. JesseSTG

    JesseSTG

    Joined:
    Jan 10, 2019
    Posts:
    236
    Seconded.
     
  3. JoNax97

    JoNax97

    Joined:
    Feb 4, 2016
    Posts:
    611
    Thirded.