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

(Case 933679) BuildPipelineInterfaces causes slow EnterPlaymode performance

Discussion in '2017.2 Beta' started by Peter77, Jul 21, 2017.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    The more .cs files are located in the project, the longer the editor needs to enter playmode in an empty scene. I created a test project with 1000 .cs files, which is a reasonable number for a medium real-world project in my experience.

    The slowest method when entering playmode, with more than 2-3 seconds in my tests, being BuildPipelineInterfaces.InitializeBuildCallbacks(). Please see the video that I attached to the bug-report.

    Reproduce
    • Open user project
    • Click File/New Scene
    • Open Window/Profiler and enable "Profile Editor" and "Record"
    • Press Play
    • Once the editor switched to playmode, turn off "Record" in Profiler
    • Select the Peak sample in Profiler, find the "EnterPlaymode" entry and expand it down this path:
    • In the profiler Profiler drill down to...
    Write down "Time ms" for the BuildPipelineInterfaces.InitializeBuildCallbacks() entry.
    • Remove all .cs files from the project
    • Repeat the test
    Observe that without .cs files in the project, BuildPipelineInterfaces is a lot faster (100x faster in my tests).


    Expected
    The number of .cs files in the project should have no affect on how long the editor needs to EnterPlaymode. In this case, BuildPipelineInterfaces should not get slower the more files are in the project.

    Ideally, BuildPipelineInterfaces.InitializeBuildCallbacks() should not be called during EnterPlaymode at all, but during builds only.
     
    dadude123 likes this.
  2. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    Peter77 likes this.
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    Last edited: Jul 31, 2017
    dadude123 likes this.
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Should be fixed in f1.
     
    Peter77 likes this.
  5. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    Excellent news, thanks!
     
  6. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Make that f2... sorry, my bad.
     
  7. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    That's fine too. Just happy it's been fixed!