Search Unity

AssetDatabase v2 Refresh Significantly Slower Than v1

Discussion in 'Asset Database' started by austin-beck, Jan 2, 2020.

  1. austin-beck

    austin-beck

    Joined:
    Oct 28, 2015
    Posts:
    19
    I'm doing some preliminary 2019.3 tests on a very large project in terms of number of individual assets. One of the features we were most excited about was v2 of the AssetDatabase, which was supposed to significantly increase Editor performance for large projects.

    After creating two side-by-side versions of our project, one on 2019.2.2 and one on the latest 2019.3 beta release, not only did we not see any gains, but we actually took a ~40% hit in asset database refresh time (2-second average on 2019.2 and 2.8-second average on 2019.3). Please note that these tests were done on a machine with a significantly better SSD than most developers at our company possess, so in actuality these numbers will be several times higher for our average dev. This is a huge concern for us because refreshes are already extremely slow on our project and eat up a lot of productivity.

    I'm hoping that someone can help me figure out what's going on here and whether or not this is something we can get fixed in a later release. I didn't see anything in the Known Issues list that seemed related to refreshes, which worries me a little bit more than I would be otherwise.

    If specifics about our project, such as number of assets and directories (we have a lot of directories) would be helpful, please let me know and I can provide those numbers.

    Any info/insight would be greatly appreciated!
     
    wlwl2 likes this.
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
  3. Anotheryeti

    Anotheryeti

    Joined:
    Jul 6, 2011
    Posts:
    10
    I'd like to say I'm also running into this, but much, much worse. Asset import times that were ~10ms in 2019.2 are now at 500ms, and every single individual model takes at least 13s. Doesn't seem to be related to asset type at all, and this is on a 2018 MacBook pro w/ solid state drive.

    Whole project took 30 hours to re-import. :S
     
  4. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    My project has been re-importing now for around 24 hours. It looks like it's importing all the .fbx files. But what I'm seeing is that every one is taking around 20 seconds. I guess I was hoping it was simply only updating the progress bar title occasionally, and was actually making more progress that what the progress bar seems to be indicating. If this is really only importing 1 item every 20 seconds, then I imagine it will take many days to complete the process. I guess I'll let it run, but I'm hoping this is a one-time process.
     
  5. Kenthria11

    Kenthria11

    Joined:
    May 6, 2017
    Posts:
    20
  6. nights007

    nights007

    Joined:
    Aug 12, 2014
    Posts:
    17
    Seeing this issue on 2020.2a15.1993 too a lot, change one character in a script and wait 20 sometimes 30 seconds for an asset database refresh. Almost unusable.
     
  7. Kenthria11

    Kenthria11

    Joined:
    May 6, 2017
    Posts:
    20
    It is currently taking me upwards of 40 minutes to reimport or refresh anything, even just one script. I am struggling through as my game is nearly ready for release, but this is insane.
     
  8. RoyM_Daemon

    RoyM_Daemon

    Joined:
    Nov 10, 2015
    Posts:
    5
    We just Updated to version 2019.4 and the AssetDatabase.refresh is taking huge chunks of time to finish when I simply add a new line to a script and click back in the editor. Took 32 seconds to finish loading the editor. They said they fixed it in 2019.3 https://issuetracker.unity3d.com/issues/focusing-the-editor-window-causes-noticeable-slowdowns But immediately in the next minor version people were reporting it again. And even in the 2020 version people are still experiencing the issue.
     
  9. mdroxas

    mdroxas

    Joined:
    Jul 30, 2018
    Posts:
    2
    Restarting Unity solves this problem for me. However, after some time, the lag returns and have to restart again.
     
    JotaRata likes this.
  10. Kenthria11

    Kenthria11

    Joined:
    May 6, 2017
    Posts:
    20
    Update: I found that deleting prefabs means import takes seconds, I wonder if that fixes it for everyone else. Of course, we really need prefabs to work. I know in 2020 they had changes to prefabs but none of the 2020 version have decent prefab importing. 1.5 hours it started taking for my 20ish prefabs, Unity is becoming unusable and Unity are being silent.
     
  11. jonc113

    jonc113

    Joined:
    Mar 10, 2013
    Posts:
    22
    I was having very long times, so I went from 2020 back to 2019. It seemed better, but then things slowed down again. 13 seconds to compile my script and 13 more just to start the game. Out of desparation, I rebooted Windows and the times both went from 13 down to 3.

    So, maybe it isn't all Unity's fault?
     
  12. accitio

    accitio

    Joined:
    Mar 1, 2020
    Posts:
    4
    exactly the same behavior for me - sometimes even more than 30 seconds. It completely slows down our progress in our current project...
     
  13. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    Everybody who still experience significant delays with the latest Unity version (2019.4 LTS, 2020.x), please submit a bug-report as described in this document: https://unity3d.com/unity/qa/bug-reporting

    If we don't submit those bug-reports, Unity Technologies probably won't or can't fix it. I like to think if they don't have a bug-report, the issue does not exist for them. Posting in this forum thread will not cause the issue to disappear, unfortunately.

    It's important that you report these issues together with a reproduction project if you want them to get fixed. If you don't do it, it might be a long time until someone else reports them or until Unity Technologies find them.

    After you submitted the bug-report, you receive a confirmation email with a bug-report Case number. Please post the Case number (number only, not the link) in this forum thread for Unity staff to pick up.
     
    futurlab_xbox likes this.
  14. darthdeus

    darthdeus

    Joined:
    Oct 13, 2013
    Posts:
    80
    Submitted a bug for this a couple of weeks ago (case 1270910). It would be great if we at least got the issue on the issue tracker to be re-opened so people could vote on it. It’s kinda insane that it’s still closed despite there being tons of comments from people saying that the issue is still there. This delay on every single script change is really making Unity annoying to use.

    @Peter77 BTW not to nitpick, but if you’re asking others to share their case numbers, why not share your own too? :)
     
  15. AlexanderZotov

    AlexanderZotov

    Joined:
    Mar 4, 2016
    Posts:
    7
    Hi guys! Here is what I got after reporting this bug :)

    "Hi,

    Thank you for contacting Unity about your issue.

    The reported problem is not a bug. AssetDatabase.Refresh window is intended to let the user know that Unity did not freeze and is currently working on something (Asset importing, script compilation, etc.). You can read more about Asset Database Refresh window here: https://docs.unity3d.com/Manual/AssetDatabaseRefreshing.html"

    So, guys, relax! It's not a bug. It's a feature :)

    My case number 1276368
     
  16. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,724
    (which is why reporting bugs to Unity is useless)
     
    gliealonso and Peaceteddie like this.
  17. nyanpath

    nyanpath

    Joined:
    Feb 9, 2018
    Posts:
    77
    I'm having this issue big time now in Unity 2020.1.4f1...
     
  18. Sarudan

    Sarudan

    Joined:
    May 21, 2011
    Posts:
    65
    I'm seeing this constantly now in 2020.1.6f1 and it's causing a huge amount of lost time. Just the simplest change will cause Unity to sit idle with AssetDatabase.Refresh showing for 6+ minutes. The only way around it is to restart Unity every 20 minutes or so, and this in itself causes a huge amount of lost productivity.
     
    mowax74 and nyanpath like this.
  19. darthdeus

    darthdeus

    Joined:
    Oct 13, 2013
    Posts:
    80
    I received a similar response to my initial bug report where they said

    which to be honest really pissed me off, because it doesn't even address the issue. But I sent them a long email linking to these forum threads and other issues, and as a result got the issue reproduced and opened (see https://issuetracker.unity3d.com/is...slow-asset-reimport-when-modifying-any-script - case number 1270910)

    So I would say don't give up if the initial response is not what you hoped for. Just the fact that they re-checked the problem and ended up replying they reproduced it and opened a votable issue for it shows it's not useless to send bug reports :)

    Maybe a question for Unity is if it would help if all of us experiencing the issue would use the iteration profiler (https://github.com/Unity-Technologies/com.unity.editoriterationprofiler) and send the exported profiler data as well? I'm not sure if this information would be useful for them.
     
    Lars-Steenhoff likes this.
  20. BinaryMonkey555

    BinaryMonkey555

    Joined:
    Dec 24, 2019
    Posts:
    1
    I've been dealing with this issue for the last few days since I've updated from 2019 to 2020.1.9 ; 1 minute to save any script and same to run the game. I always save to Dropbox, so I closed Dropbox to see if there was a difference and it runs now just like before almost instantly. I don't know if that was the problem but I thought i post it here.
     
  21. Chopium

    Chopium

    Joined:
    Jun 15, 2015
    Posts:
    19
    Currently getting this issue w/ a fresh-ish build on 2020.1.4f1.
     
    Ziflin likes this.
  22. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    102
    It start from 2019.3.x as v2 pipline is forced to be used.
    Unity wont fix this because this issue seems quite related to the hardware and even the same machine would have different performance.
    It is really hard to create this problem even even even you reinstall your system.
    This S*** really ruied unity and hope the team could take a little care on it.
     
    Lars-Steenhoff likes this.
  23. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Same here. 2 minute 40 seconds to update one line of code in a project just opened 3 minutes ago in v2020.1.6.
    Intel I7, 16gb RAM.
    Unity, right now, is a completely useless application.
     
  24. DevinW

    DevinW

    Joined:
    Jun 19, 2014
    Posts:
    37
    I also find the new AssetDatabase.Refresh to be unacceptably slow.

    Using the Experimental Enter Play Mode setting in Project Settings helps when doing scene playing and testing, but the time after script compile is really unacceptable and seems completely unavoidable in 2020.1.6f1. It's pretty sad when my extremely tiny projects take 30sec and my larger ones 2mins+.

    I also use Rider and can start refreshing the asset database before I tab back over to Unity but that's not really a good enough solution.
     
    Ghat-Smith likes this.
  25. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    I have exactly the same issue, not really sure what I can do about it. I'm using 2019.4.14 and every time I add a file/delete a file/compile it hangs for a good 30 seconds, this is for a tiny project that I just started. This didn't happen in 2019.3 with a huge project (20+ GB), even though I was using Asset Database V2 there as well. Maybe it's because I switched it from V1 to V2 instead of starting in V2 already.

    I was able to capture the freeze using the Profiler after deleting a .txt file from my project, here's what it said:



    Is it causing something to run in Visual Studio? That seems to be where the majority of the hold up is. It seems odd that this empty .txt file is causing all this work, it's not a script or anything so not sure why VS needs to do anything.

    For clarity, I'm also running this new project in URP version 7 I believe, with minimal packages. I'm using the Input System and an SSAO package I got from the store. I'm including this info because I thought maybe the .dll files used by one of those packages could've been causing a slowdown, but I'm not totally sure. There are no errors so I'm not sure how they could be affecting it.

    I also captured a freeze that happened from saving changes to a CS file from VS, before compilation. This one is a little different:



    EndReloadAssembly seems to be the culprit here. For some reason, beforeProcessingInitializeOnLoad, afterProcessingInitializeOnLoad, and ReloadAssemblies each seem to take 35,000 ms:



    Any ideas would be helpful here, I'm at a complete loss and really can't see myself building this project without a fix. In my last project changes like file deletion would take a few seconds at most, here it takes 30+, database would take a second or two before compiling, here it takes 90+ seconds. Sometimes it happens and sometimes it doesn't, I really have no clue why the behavior is inconsistent sometimes. I believe restarting Unity may be what causes the times to go back to normal.
     
  26. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    102
    rider wont solve,it is completely a hardware bug.And unity can not find and recreate it!
     
  27. TabuuForteAkugun

    TabuuForteAkugun

    Joined:
    Sep 28, 2015
    Posts:
    58
    Been getting this as well, I'm in 2020.2. I have a powerful machine since I develop. Sometimes what would happen immediately will take at least 3 minutes.

    I can wait for the issue to be fixed, but it's a bit annoying. If nothing can be done I'll just grin and bear it, then.
     
  28. andrew210

    andrew210

    Joined:
    Apr 23, 2014
    Posts:
    241

    This seems to take between 10 to 15 minutes every time unity starts (the projects folder is 6.5gb). Given that I can probably expect the editor to crash 3 or 4 times a day on an average day (2020.1.17f1) it gives me a lot of time on my hands. Have tried updating to 2020.2.x but there appears to be anumber of breaking changes updating to that that we're not prepared for right now
     
    keeponshading likes this.
  29. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Hey @andrew210 ,

    There's a way to profile how long it takes to open the editor.

    If you launch unity with the -profiler-enable command line argument, it'll record the first frame of the application and put it into the profiler.

    For example:
    Unity.exe -projectpath path_to_game -profiler-enable


    Then you'll come up with a profiler capture. In case you can't save it, you can have the Profile Analyser installed and Pull the data, and save. If you have that, you can DM the capture to me, or post it here if you think that's ok too :)

    And we can go from there.
     
    andrew210 and MartinTilo like this.
  30. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Hey @SomeGuy22
    Thanks for the screenshots and the write up.

    To answer your question about why a .txt file takes so long is that Visual Studio/Rider need to keep track of certain assets for their projects. Generally its .cs files, but you can actually see what the IDEs look for in the Preferences -> External Tools, for example:

    upload_2021-2-2_21-49-2.png

    In case you want to temporarily fix this issue while there's a fix available, you can select Open File By Extension and that should remove the 24 seconds you reported in your screenshot:
    upload_2021-2-2_21-54-55.png

    With regard to the InitializeManagedCompilationPipeline 35 seconds seems a bit crazy, but we should be able to figure that out in more detail. From the screenshot you posted, it doesn't look like its a Deep Profile so perhaps you could do one and post it up here? Or even better, save it out (if you can) and send it to us. If that fails, using the Profile Analyser and saving it out via that could help for sharing too.
     
    futurlab_xbox and MartinTilo like this.
  31. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    Right, I figured it out shortly after I posted that VS was considering the .txt extension which is why it was going through that long chain. I also realized that the slowdown was only happening for me after I leave my project open for some time, and that restarting Unity seems to make it go back to normal, i.e. the wait time is as expected, only a second or two.

    I actually ran a deep profile and have more details over on this thread, the deep profile specifically is on the post from December 7th. I also submitted a bug report and have been talking to the QA rep about reproduction steps; the case number is 1299648. I also thought ahead and saved out the deep profiler info on one of these slowdowns. I still have the file but the size is over 1 GB so if you have a secure way to transfer it and think it would help I can send it over.

    To recap on my issue (can't say for certain what everyone else is facing) when I leave Unity open for a few hours is when it enters this "bugged" state and I end up with these massive slowdowns every time I compile or change a VS managed file. This is in Unity 2019.4.14f1. When I restart Unity the problem goes away so it's not as drastic as I first thought, but still clearly a bug that could get annoying and might be even worse on slower hardware.
     
  32. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
  33. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    I'm still not exactly certain what causes the issue in the first place but I believe I can say with some confidence now that updating Visual Studio 2017 seems to have solved the problem. Before I was using something around version 15.0 (I think build 26228.30), and when I did a manual update for VS 2017 it became version 15.9. I haven't once encountered the problem since that update which was about a month ago. Except for one occasion where Play mode was still slow to start even after a few tries, yet I'm pretty sure the .txt file deletion times were as expected. So that might've been a different issue or just my HDD being slow which tends to happen sometimes. Restarting Unity fixed it and I haven't experienced slow Play mode since then.

    I guess there is just something about the older VS version which caused the Refresh to hang sometimes(?) although why it only happened after waiting with Unity open is a mystery still. As with versions of Unity I was also hesitant to update VS which might've broken my setup. Somehow I didn't consider that VS 2017 still got patches and I wouldn't be forced to go to 2019 or something like that. Updating from within VS went smoothly and even fixed up some other issues I was having with Unity like this problem. So I would recommend moving to a later patch if anyone experiences this slowdown. Hopefully that helps someone in the future! It was a pain to track down a fix but it ended up being pretty simple in the end.

    Not sure if this will solve others' issues with refresh and slow loading times, but it's worth a try. I'm sure investigating the exact connection here might be helpful to improve Unity stability down the line, in the case something like this happens again. But with a solution for the end user available I would say it's not as high of a priority, though I'll let the Unity devs decide. Thanks again to everyone that weighed in and offered suggestions, it was a huge help and I'm extremely appreciative of the support! :)
     
    Unity_Javier likes this.
  34. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937

    I got exactly same behaviour by jumping to 2020.3.x LTS.

    Starting the project takes 5 to 10min due to Refresh Asset Database on every startup.
    Any news here?

    1.JPG

    Project startup before was under 1min.
     
    Last edited: Apr 17, 2021
  35. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    I assume the Editor still makes logs during this process right? Can you check the Editor log file and see if there is anything odd happening during the refresh? Log file location can be found here.

    The reason I'm curious is because while my update of VS has improved the situation, I still seem to have encountered a slow refresh while working in the project. When I checked the Editor logs I found that I was getting spammed with a ton of licensing errors, then after restarting Unity the errors would go away and the refresh speed would be back to normal. I wonder if you also have licensing error problems, then maybe we could track it down to the same underlying function call.
     
  36. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Hi @keepsonshading,

    AssetDatabase Refresh drives a lot of systems, such as Compilation, callbacks to scripts, object loading & unloading, and checking the state of the project on disk.

    What we can do is, if you can profile startup we can try to figure out what’s going on.

    To profile startup, you can launch Unity via command line like so:

    Unity.exe -projectpath path_to_project -profiler-enable

    That will tell the profiler to begin capturing startup, and when complete the data will be available on the profiler. We can go from there, especially if this is happening every time you open the editor!
     
    Last edited: Apr 18, 2021
  37. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hi. Thanks for support.
    I openend the project with the profiler enabled.

    Time to open the project:
    Fast SSD: around 10min
    Normal SSD: more than 20min
    1.JPG

    Unity Editor RAM use goes up to 48GB during opening and
    falls back to 9.8GB when project is open

    Then i added the
    com.unity.performance.profile-analyzer package
    to the project.

    I stuck on

    "That will tell the profiler to begin capturing startup, and when complete the data will be available on the profiler. We can go from there, especially if this is happening every time you open the editor!"

    The Pull Data is not available after startup.
    The Load button is available but where i can find the profiler capture from startup?
     
    Last edited: Apr 19, 2021
    Unity_Javier likes this.
  38. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Hey!
    Ok, lets see how we can get those 20mins down.

    First off, you need to open the Profiler (by going to Window -> Analysis -> Profiler) in order for PullData to become available, as the Profile Analyzer interacts with the ProfilerWindow in a way.

    There should only be one frame, which would say something like 600,000ms (in the 10minute case) and thats where we need to drill down.

    Markers for:
    1. PostProcessAllAssets
    2. InitializeOnLoad
    3. ImportAndPostprocessOutofDateAssets
    4. ReloadAssembly

    Would be interesting to expand so we can see what can be done about each of those areas, but also other areas as well that have a high percentage of the measured time.
     
  39. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Ok. Thanks.
    That did the job.
    Here is the profiler content from a very fast SSD project startup.
    Unity 2020.3.4f1

    Is the Shader.CompileGPUProgram (Pos.3) the problem here? Is it done at every startup again?
    This PC has 2x NVIDIA 3090 what would explain why this startup is much faster than on a normal

    Profiler_.JPG

    some fullscreen views

    f1.JPG

    f2.JPG


    Same project.
    PC with normal SSD and RTX 2080.
    Unity 2020.3.3f1

    2.JPG
     
    Last edited: Apr 19, 2021
  40. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Hey!
    Ok, perfect.
    So, this capture shows that it took 330,579ms = 5.5mins (lower than before, but that's not the point).

    From the capture of the ProfileAnalyser I can see that the main timesink is going into Shader.CompileGPUProgram, which is taking 287,807ms (or 4.7minutes) out of those 5.5 mins.

    I can also see the AssetDatabase code is taking ~29,000ms out of which textmeshpro is takint 14,000ms inside its OnPostProcessAllAssets method.

    Let me see what I can do here.
     
    keeponshading likes this.
  41. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Thanks for looking into.
    A while a go i was surprised that a TextMesh Pro package upgrade to latest fired a most complete reimport of the assets. Only as side information.

    The first capture came from a PC with fastest hardware components we have available.
    128GB RAM, 2xNVIDA RTX 3090.....
    Unity 2020.3.4LTS
    I switched to this for testing because i was not able to work on the project anymore on our average pc´s.


    Here is the capture from a normal high end working pc which shows a different behaviour.
    But i have no profiler knowledge at all.
    Same project.
    But Unity 2020.3.3LTS
    This is the average PC configuration we use and shows up my real world problem.
    56GB RAM, Nivdia RTX 2080

    1177918.0002ms = 19.63196667min startup
    done at every startup

    2.JPG


    after update to
    2020.3.4f1 from 2020.3.3f1
    Textmesh 3.0.5 from 3.0.4
    faster but still the long Shader.CompileGPUProgram,

    3.JPG
     
    Last edited: Apr 19, 2021
  42. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    Hi!
    Can you please check the size of your 'Library/ShaderCache/EditorEncounteredVariants'?
    Can you try deleting it and checking if the startup time improves?
     
  43. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hi.

    WorkingPC

    Size of ´Library/ShaderCache/EditorEncounteredVariants´= 795KB

    Size of `Library/Shadercache" =

    1.JPG


    Reopening after deletetion.

    37853ms = 0,63088333min

    Nice. Startup time is 0.6 min instead of 19min before.
    Size of ´Library/ShaderCache/EditorEncounteredVariants´= 9KB now

    0.JPG


    Second test with project on the fast PC shows same speed now.

    00.JPG


    Do you know what is bloating up the
    Library/ShaderCache/EditorEncounteredVariants'
    over time?
    DefaultBuild o9r rebuild of the Addressables or the general build at all?

    I use one
    HDRenderPipelineAsset
    and
    only one
    Quality 'High` HDRP setting with this HDRenderPipelineAsset

    for the main scene who is allowed loading 5 addressable scenes.(cars and tracks)
    and other working scenes in the project.

    Overall project size is more than160GB.
     
    Last edited: Apr 20, 2021
    Unity_Javier likes this.
  44. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    EditorEncounteredVariants contains a list of all shader variants that the Editor compiled for itself. When loading, the editor fetches those variants from the cache to avoid showing the "async loading" status.

    We'll fix this, thank you for checking! I'll paste a link to the issue tracker when it's there.
     
    Unity_Javier likes this.
  45. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    We'll be adding information about this to the Manual, but in essence this is what's happening when TextMeshPro or any other AssetPostprocessor either introduce a new Pre/Post processing function or update the AssetPostProcessor version:

    postProcessorType is a readable name makes it easier to understand what sort of postprocessing will affect an asset:
    1. ModelPostprocessor
    2. TexturePostprocessor
    3. AudioPostprocessor
    4. SpeedTreePostprocessor
    5. PrefabPostProcessor

    Once we know what sort of postprocessor is associated with an asset type, then we can be more precise about the functions which will have an effect on the import result of an asset.

    For example, a Texture (.png) would be imported by the TextureImporter and as such it would be assumed that the postprocessor method associated with it is a TexturePostProcessor. We then take this information, look through the available postprocessors that implement either of:
    1. OnPreprocessTexture
    2. OnPostprocessTexture
    3. OnPostprocessCubemap

    And get the version of said postprocessor, and add it to a hash.
    If the hash changes, that means the version of one of the postprocessors associated with the texture intentionally changed, and as such, the import result will be affected by it. Thus, a reimport of every texture is required.



    Now, this is not ideal, because in many circumstances, you want to filter out for a particular texture inside a postprocessor and that means changing the version should "only" affect the texture you want, and not others. There's some work being done on that front fortunately :)

    In the meantime, if re-importing of textures or any of the 5 asset types mentioned above keeps happening, one tip I can think about is to use AssetBundles (if you're developing for just 1 platform it makes it easier). If an AssetBundle is being used, then the PostProcessor won't have an effect on the texture, since it is essentially frozen in that AssetBundle.
     
  46. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    190
    Woohoo! :D
     
    keeponshading likes this.
  47. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    I did a build of my my main scene with addressables.
    Library/ShaderCache/EditorEncounteredVariants´= 24KB then

    Then i build a nother scene out of the project.
    Library/ShaderCache/EditorEncounteredVariants´= 32KB then

    i started with
    Size of ´Library/ShaderCache/EditorEncounteredVariants´= 9KB after deletion

    So i think that could be the problem. After every build the file grows?

    Anywhere. Thanks for now. I could work again in my productive project.


    Fun fact.
    In another test project i migrated the MegaCity scene to 2020.3x and 2021.1.x releases.
    There a inital build (further builds 10min) takes up to 6 hours and generates tons of shader variants.
    I think for all subscenes and LOD´s again. But i know this is blood preview stuff and will be correted over time.
     
  48. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Thanks for the info and bringing me back to the track.
    My project has reached a critical size i only can work with addressables and async loaded scenes with default addressables setups.
    I think i need to work more into Asset Bundles. For now it s pretty new to me.

    Would be nice if there is some more information or best practices to handle big projects where async loaded scenes like cars and tracks where each easily exceed the old 4GB limit.
    After using addressables this worked for me. But i think there is more manual work needed now because project size is growing fast.
     
    Last edited: Apr 20, 2021
  49. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    If you build the same scene, it shouldn't grow any further.
     
  50. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    I did several new project starts and build content of adressables and builds on both projects with the same scene.

    there is steady raise from
    Library/ShaderCache/EditorEncounteredVariants´= +4t o +18 KB pro action

    Because i do it often per day this would explain the inital size of 795KB i deleted.

    In one or two weeks would be back there.
    However. Now i know that deleting it solves my problem for now.