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. Dismiss Notice

Compile Times and AssetDatabase.refresh

Discussion in 'Asset Database' started by learc83, Jun 18, 2020.

  1. learc83

    learc83

    Joined:
    Feb 28, 2018
    Posts:
    41
    I'm Profiling my compile times with the CompilationPipeline events, and the actual compile time is only about 1.6 seconds. However when I make a script change the total time from editor focus until the refresh is done is about 8 seconds (I'm on a Ryzen 3900x with 32GB RAM).

    It looks like a good bit of that time is spent on AssetDatabase.Refresh. Is there anything I can do to speed this up? And are there any other processes that are happening before or after compilation that I can look into speeding up?
     
    akuno, nerdax and ImpossibleRobert like this.
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,438
    Is your project using AssetDatabase v1 or v2? You can see that under "Edit > Project Settings > Editor":
    upload_2020-6-19_8-19-8.png
     
  3. learc83

    learc83

    Joined:
    Feb 28, 2018
    Posts:
    41
    It's using version 2.
     
  4. darthdeus

    darthdeus

    Joined:
    Oct 13, 2013
    Posts:
    53
  5. darthdeus

    darthdeus

    Joined:
    Oct 13, 2013
    Posts:
    53
    For the sake of anyone running into this as well, check out this thread https://forum.unity.com/threads/case-1171423-asset-import-significantly-slower-than-in-unity-4-6.714986/ and the newly opened issue https://issuetracker.unity3d.com/is...slow-asset-reimport-when-modifying-any-script that you can vote on.