
Determining which parts were independent and running them in parallel gave huge wins.” Also, lots of import tasks operate on every mesh, vertex, animation, or material in the file. “For example, instead of allocating memory per vertex, which was very slow for large meshes, some algorithms could run a pre-pass to count the total required memory and then allocate it in one block. “There were a lot of different problems and solutions, but a few of them stood out,” he explains. Richard Kettlewell from the optimization team has been focused on speeding up model importing throughout the 2021 cycle. For Unity 2021.2, they managed to reduce the startup time of the Editor from 3 mins 36s down to 1 min 17s for a project with 900,000 text assets, as well as helping to speed up project opening times for smaller projects by an average of 8.7%. For example, the team reduced memory allocations on threads or during sorting and introduced parallel gathering of all project files and folders.

Just to make sure that optimizations for large-scale projects did not regress performance for smaller, real-world projects,” says Javier Abud. We would chip away around 15 seconds of startup time each week on the test project and would then verify these changes with 22 real-world projects. “Right away, there were some low-hanging fruit, but also there were a number of situations that required a bit more outside-the-box thinking.

They’ve also collaborated on a suite of internal tools that automate the process of gathering metrics on how changes to the Asset Database impact the performance of the Unity Editor. Starting with a synthetic test project of 900,000 assets, Javier Abud and Jonas Drewsen, senior software engineers from the Asset Database team, collaborated on a benchmarking framework that led to a number of optimizations and improvements to Editor startup times. Since the Asset Database is responsible for a lot of Unity processes during project startup, we wanted to see how impactful it would be to optimize the Asset Database code.
