[Check the original post at Unity Performance Checklist for a Top-Performing Game in 2020+]
In this post you'll get a simplified version of my Unity performance checklist that I've been completing over the years.
Game development is a very complex topic, which makes forgetting action points extremely likely. A mental Unity performance checklist is just not enough.
In this post you'll get access to a Unity Performance Checklist to:
Improve your CPU performance
Reduce the GPU load
Decrease memory usage, loading times and build sizes
I hope you'll be able to use it over and over again across your projects.
Performance-Checklist-Thumbnail
This should be no secret, but...
Game development is a life-lasting career plagued with mountain-sized obstacles along the way. It is complex and you might lose chunks of your sanity in your journey.
The bright side? The #gamedev trail hides valuable treasures and sexy rewards.
As you advance in the game development career, you learn new patterns, processes and tricks that over time will become part of your development style.
The downside to learning is that we also unlearn. Well, kind of.
The useful insights you and I gained years ago are probably hidden by now in the darkest corners of our minds, desperately waiting for the right trigger to surface.
Only that... some of these mental triggers won't happen when you need them.
I sometimes see myself and others doing the same performance-ruining mistakes over and over again, project after project.
And this doesn't happen because of a lack of knowledge, but rather due to forgetting small thingies.
And so I work hard to make knowledge more explicit for me and for others. By documenting your learnings, you'll help not only others but also your future self.
I mean, just look at this blog...
A checklist is a useful piece of documentation that will give you quick reminders about often-forgotten facts. You can quickly scan over it and perform a sanity check in just a few minutes. That's why checklists are so powerful.
And you should have one. Now, I can't force you to write a checklist — that's my job—, but at least consider using one. In this post, you'll be tapping into my personal unity performance checklist.
As always, these are suggestions for you to think about. These tips have gotten me far in the industry of game performance, but you must evaluate whether they make sense for your game and for you.
Ideally, you should always measure your changes.
Don't attempt to sue me if following my advice steals a millisecond from your game (but feel free to toss in some coin if you gain it).
To keep it simple, I divided the checklist in three main sections: CPU, GPU and Memory/Loading Times.
At the end of the post you'll have the chance to get an extended version of the list that includes further explanations and online references.
Pay attention to the star symbol (*). These usually mean: be careful with that change, as it will have negative side effects in other unity performance areas.
If you're curious about the importance of checklists, check out The Checklist Manifesto (no referrals — that's why I'm poor).
Have fun, my friend.
Quick Navigation (redirects to new tab)
Chapter 1: Unity CPU Performance Checklist
Chapter 2: Unity GPU Performance Checklist
Chapter 3: Unity Memory Performance Checklist
Chapter 4: The Extended Unity Performance Checklist (91+ Tips)
CHAPTER 1:
Unity CPU Performance Checklist
You can get higher CPU performance by reducing the total CPU work you do or by splitting it into different threads.
The best way to measure the effect of your changes is by using the Unity Profiler and to analyze the CPU section. You'll want to focus on the main thread and render thread.
Tip for Unity 2019.3+: increase your profile frame count to 2000 in your profiler settings to detect spikes easily.
decoration-motherboard-cpu
Rendering: Use a single camera, especially in mobile | Rendering: Try lighter APIs such as Vulkan or Metal |
---|---|
Rendering: Are you using occlusion culling for interiors? | Rendering: Pre-bake 24/7: lighting, shadows, reflection probes* |
Rendering: Create atlases to reduce Unity SetPasses and Draw Calls below 100 on mobile. No multi-material assets (evil asset store) | Rendering: Leave all static and dynamic batching on* |
Rendering: Keep particle systems small in world space — i.e. small bounding boxes | Rendering: Are all your particle systems procedural? |
UI: Use color property instead of in-sprite color variations and use the new SpriteAtlas tool | UI: Watch "Unite '17 Seoul - Tips and Tricks for Optimising Unity UI" |
UI: Avoid per-frame changes in UI components (UI properties or RectTransforms) | UI: Don't use auto-layouting components on dynamic UI |
PlayerSettings: Keep only the target architecture you're really building for | PlayerSettings: Use il2cpp in master mode, disable script debugging |
PlayerSettings: Use GPU skinning* | GraphicsSettings: Enable only necessary built-in shader settings |
Animation: Enable Optimize Game Objects on rigging import settings | Animation: Use animators exclusively in characters. For the rest: custom scripts or tweens. |
Animation: Reduce blend tree complexity in animations | Animation: Reduce bone and vertex count for skinning. Aim for max 2 bones on mobile |
VR: Use single-pass stereo | OculusVR: Set CPU level to 4* |
Unity Scene Hierarchy: Don't forget scene hierarchy static flags on static game objects |