Hi everyone, continuing our focus on performance and fast iteration, we’ve added some asset import improvements to 2021.2 alpha lately. These include texture and model import optimizations, a new option to import textures and meshes in parallel, and various other scalability optimizations.
Here’s a test importing all the textures, models, prefabs and scenes from Book of the Dead: Environment project.
This contains 2.25GB of source asset data (346 textures, 133 models, 214 prefabs, 6 scenes). Timings are on Windows, AMD ThreadRipper 1950X (16 threads), SSD storage machine. We’re comparing Unity 2020.3.10, 2021.1.9 and the current 2021.2 alpha (a19).
Model (fbx, obj, sketchup, …) importing in particular got optimized quite a bit in 2021.2. On average it’s maybe “twice as fast”, but we’ve also seen some pathological cases where a model that used to take hours to import, now imports in several minutes.
Note that parallel asset importing is off by default for now. When turned on, at the moment it only works for texture & model imports, all other asset types are imported in a single process as before. The setting is in Project Settings → Editor → Refresh section. In this example, we see enabled parallel asset import with 4 asset import worker processes.
If, for iteration time purposes, we also use the “Fast” texture compressor option in Build Settings (this does not change any texture sizes or formats, just spends less effort trying to come up with the best possible compressed texture pixels; see this thread for details), all the assets import in 38 seconds. This is a 3.8x speedup compared to the 2021.1 version!
Switching the same project to Android (ASTC texture format) platform for the first time takes 87 seconds, using both parallel asset import with 4 asset import work processes and the Force Fast Compressor option. This speeds up ASTC texture compression dramatically (6.6x speedup!). However the textures will contain slightly more compression artifacts, so you don’t want to have this setting on for your final build.
Scaling to Large Projects
In our test projects with a large number of assets (like “a million”), we’ve managed to cut the editor startup time by around 50%, compared to previous versions. This is due to various optimizations to asset database processing and data structures. For example, opening a project with 900 thousand asset files, when everything is up to date, took over 3 minutes before, and now takes just over a minute.
Opening of scenes with very large & flat hierarchies (lots of objects at the root level) is also much faster now.
Feedback needed!
It would be useful to have more data on how these improvements work for your 2021.2 alpha projects so far, or if you’re running into any issues. We are therefore asking you to share your Editor performance benchmarks! Please share your numbers in the thread below or send me a DM.
How do you get to those numbers? You can take a look at the editor log file to see import times of individual assets or the whole import (it looks like “Asset Pipeline Refresh: Total: 139.7 seconds”). Among the several command line arguments you can supply upon opening Unity, the -profiler-enable command line argument allows you to profile the Editor during launch. Using this argument can help you see what happens during startup and what takes time.
We’ve also created this Editor Log Parser that will output a CSV file with all the numbers, so that we can put some of those easy to read graphs together. This is especially useful when there is no library and the full project is reimported.
Here are the numbers that we’re most interested in, in the simplest possible format:
Startup
Unity 2019.4: xx seconds
Unity 2021.2: xx seconds
Full project import:
Unity 2019.4: xx seconds
Unity 2021.2: xx seconds