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

Resolved 2022.2.0b8: Slow Complete Domain on certain machines

Discussion in '2022.2 Beta' started by Occuros, Oct 3, 2022.

  1. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    300
    We tested a small sample project on two machines (AMD and Intel):

    On the Intel Machine (using 12th Gen Intel(R) Core(TM) i9-12900K) the `Completing Domain` step takes around 20x times longer than on the AMD (using AMD Ryzen 9 5950X) machine.

    On both, we freshly cloned the same project and make simple code changes (changing one character) to trigger recompilation.

    Using assembly definitions or not doesn't make any difference in the project.


    What could be the cause of this vast difference? (20s to 3m of reload after each script change)
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Did you try running the profiler? Does either of the machines use a slower hard drive than the other? It really could be caused by many things.
     
  3. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    300
    I tried to run the profiler in the editor, but even the profile just stops at this point on the “slower” machine.

    both machines use SSD’s and are nearly identical in terms of performance (graphic cards etc.)

    Also in previous LTS versions the issue isn’t there, only when using 2022.

    Also important to mention is that we use ECS and dots with nearly all packages (Entities, Physics, Netcode).

    in previous editor version and the same packages 0.51, we didn’t experience that slowdown.

    Anything else we can use to investigate what might be causing this?
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    That's expected. You need to:

    1. Enable editor profiling;
    2. Extend the "history" of the profiler to at least 1 minute (ideally to as long as the hang is)
    3. Reproduce the hang
    4. Pause the profiler
    5. Find the hang in the profiler. The whole hang will be contained within a single frame, so it will look like there was one really long frame/lag spike.
     
    Occuros likes this.
  5. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    300

    It seems the main difference is the amount of time spent in:


    JitCompilerService.CompileInternal() [Invoke]

    Also on the AMD machine, there is just one spike, while on the Intel machine we have multiple long spikes:
    slow_multi_spike.png single_spike.jpg

    The profiler data is too large to upload here, shall I add a link to a google drive folder or similar?
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Sure.
     
  7. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    300
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Could you check if by any chance the Intel machine has "synchronous compilation" in burst settings enabled?
    upload_2022-10-5_13-48-17.png
     
    Occuros likes this.