2020.2: AssetDatabase.Refresh comparison against Unity 4.6

During the Unity 2019.3 beta phase I reported that AssetDatabase.Refresh, which occurs after adding or updating assets in the project, is significantly slower than in earlier Unity releases such as Unity 4.6.

Today I used the same project to retest whether it improved in Unity 2020.2. I triggered the "Create 100 assets" three times in each version, here are the results:


Unity 4.6.9f1

  • AssetDatabase.Refresh took 2.12 seconds
  • AssetDatabase.Refresh took 1.99 seconds
  • AssetDatabase.Refresh took 2.03 seconds

Unity 2020.2.0a21

  • AssetDatabase.Refresh took 1.35 seconds
  • AssetDatabase.Refresh took 0.14 seconds
  • AssetDatabase.Refresh took 0.17 seconds

Conclusion
AssetDatabase.Refresh performs significantly faster in Unity 2020.2.0a21 with the provided test project.

[spoiler]

6259046--690350--upload_2020-8-30_8-10-43.png

[/spoiler]

6259046--690347--AssetImport_4.6.zip (15.2 KB)

9 Likes

Have u tried Unity 2020.2.0a21?

1 Like


I used a21 to do the test actually, fixed in first post. Thank you.

1 Like

Congrats dev team!

Now... compile time?

1 Like

Compile time is generally fast. Assembly reload time, on the other hand... which is even more annoying as that triggers a lot more often than just after code changes...

Good thing you can turn assembly reloading off!

You can turn assembly reloading off for only one of the various cases that normally cause an assembly reload.