Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question Unity 2022.3.4f1 - Slow to open projects

Discussion in 'Editor & General Support' started by evyatron, Jul 6, 2023.

  1. evyatron

    evyatron

    Joined:
    Jul 20, 2014
    Posts:
    132
    I put this post under Question, but not sure if it's actually a bug.
    My project is a new prototype and very minimal - about 10 scripts, 5 materials, 1 small model. URP, Cinemachine, New Input.

    Whenever I open it (after a PC restart or sleep) it can take a several minutes to load.
    I noticed a few things in the Editor log taking relatively long time:
    • Domain Reload Profiling: 5392ms
    • Then another Domain Reload Profiling: 11716ms
    • Asset Pipeline Refresh (id=c3ba194a1643b164291b40babf2363d2): Total: 115.525 seconds (most of it "Untracked", and another Domain Reload in there?).
    I mostly wanted to ask whether this is expected in 2022?
    It definitely wasn't like that on older versions (2021 opened faster for me with a full-fledged game with hundreds of assets), but I'm not sure if I have something set up wrong or if 2022 is just slower.

    (I have an i9, 32GB and an SSD, so unlikely a hardware issue)

    (also as an aside I think it would be really helpful if timings were standardised - either as 0.5s or 500ms - to be able to analyse logs faster)

    Code (csharp):
    1. Asset Pipeline Refresh (id=c3ba194a1643b164291b40babf2363d2): Total: 115.525 seconds - Initiated by InitialRefreshV2(ForceSynchronousImport)
    2.     Summary:
    3.         Imports: total=0 (actual=0, local cache=0, cache server=0)
    4.         Asset DB Process Time: managed=0 ms, native=97449 ms
    5.         Asset DB Callback time: managed=26 ms, native=0 ms
    6.         Scripting: domain reloads=1, domain reload time=11809 ms, compile time=6187 ms, other=52 ms
    7.         Project Asset Count: scripts=3773, non-scripts=1285
    8.         Asset File Changes: new=0, changed=0, moved=0, deleted=0
    9.         Scan Filter Count: 0
    10.     InvokeBeforeRefreshCallbacks: 0.314ms
    11.     ApplyChangesToAssetFolders: 0.059ms
    12.     Scan: 10326.699ms
    13.     OnSourceAssetsModified: 0.004ms
    14.     GetAllGuidsForCategorization: 0.944ms
    15.     CategorizeAssets: 149.671ms
    16.     ImportOutOfDateAssets: 6116.883ms (-88.198ms without children)
    17.         CompileScripts: 6187.301ms
    18.         ReloadNativeAssets: 0.013ms
    19.         UnloadImportedAssets: 15.907ms
    20.         EnsureUptoDateAssetsAreRegisteredWithGuidPM: 1.031ms
    21.         InitializingProgressBar: 0.011ms
    22.         PostProcessAllAssetNotificationsAddChangedAssets: 0.000ms
    23.         OnDemandSchedulerStart: 0.820ms
    24.     PostProcessAllAssets: 26.288ms
    25.     GatherAllCurrentPrimaryArtifactRevisions: 0.001ms
    26.     UnloadStreamsBegin: 0.992ms
    27.     PersistCurrentRevisions: 0.151ms
    28.     UnloadStreamsEnd: 0.014ms
    29.     GenerateScriptTypeHashes: 1.696ms
    30.     Untracked: 98903.459ms
    There's also the Domain Reload:
    Code (csharp):
    1. Domain Reload Profiling: 11716ms
    2.     BeginReloadAssembly (123ms)
    3.         ExecutionOrderSort (0ms)
    4.         DisableScriptedObjects (5ms)
    5.         BackupInstance (0ms)
    6.         ReleaseScriptingObjects (0ms)
    7.         CreateAndSetChildDomain (22ms)
    8.     RebuildCommonClasses (30ms)
    9.     RebuildNativeTypeToScriptingClass (10ms)
    10.     initialDomainReloadingComplete (22ms)
    11.     LoadAllAssembliesAndSetupDomain (5471ms)
    12.         LoadAssemblies (5349ms)
    13.         RebuildTransferFunctionScriptingTraits (0ms)
    14.         AnalyzeDomain (187ms)
    15.             TypeCache.Refresh (166ms)
    16.                 TypeCache.ScanAssembly (158ms)
    17.             ScanForSourceGeneratedMonoScriptInfo (13ms)
    18.             ResolveRequiredComponents (8ms)
    19.     FinalizeReload (6059ms)
    20.         ReleaseScriptCaches (0ms)
    21.         RebuildScriptCaches (0ms)
    22.         SetupLoadedEditorAssemblies (4818ms)
    23.             LogAssemblyErrors (0ms)
    24.             InitializePlatformSupportModulesInManaged (4ms)
    25.             SetLoadedEditorAssemblies (3ms)
    26.             RefreshPlugins (0ms)
    27.             BeforeProcessingInitializeOnLoad (68ms)
    28.             ProcessInitializeOnLoadAttributes (4658ms)
    29.             ProcessInitializeOnLoadMethodAttributes (82ms)
    30.             AfterProcessingInitializeOnLoad (2ms)
    31.             EditorAssembliesLoaded (0ms)
    32.         ExecutionOrderSort2 (0ms)
    33.         AwakeInstancesAfterBackupRestoration (4ms)
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,109
    Have you tried deleting the Library folder?

    Also check that the project root folder is excluded from Antivirus, including Windows Defender and possibly other "scanner" or "cleaner" tools.
     
  3. evyatron

    evyatron

    Joined:
    Jul 20, 2014
    Posts:
    132
    Thanks for the suggestions, unfortunately neither really "fixed" it.
    Still spends a lot of time loading the project, most of it "Untracked", with three different "domain reload".
     
  4. Jerry_Davis

    Jerry_Davis

    Joined:
    Jan 29, 2022
    Posts:
    5
    don't use 2022.3LTS,it is more slower, I regreted use it
     
  5. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,109
    Very informative. How about providing some measurements, even stopwatch timings?

    Have you tried 2023.1?