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.
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.
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.
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?
Shaders: No standard shader, no GrabPass on mobile
Shaders: Use necessary decimal precision only (half vs float) on mobile
Shaders: avoid sampling from reflection probes
Shaders: Avoid conditionals
Color Space: use gamma instead of linear on mobile
Chapter 3: Unity Memory Performance Checklist
We’re getting to the end of the blog post.
You see, optimizing CPU and GPU will often give you all you need to achieve high frame-rates.
But high FPS won’t be enough if your game crashes due to extreme memory pressure. And long loading times will certainly upset your players. Really, they don’t enjoy waiting nowadays with so many distractions.
So, what are going to do to optimize memory usage and bandwidth?
Capacity: Use indirect references instead of direct references for heavy content
Capacity: Remove direct references to inaccessible content
Capacity: Global GameObjects shouldn’t direct-reference heavy content
Capacity: Seldomly used scene GameObjects shouldn’t direct-reference heavy content
Capacity: Try texture streaming*
Capacity: Set optimal compression settings for textures, meshes, animations, etc..
Capacity: Disable read/write asset import setting whenever possible
GC: Reduce memory allocations to avoid growing the reserved heap size
AudioClips: enable streaming on long clips*
Performance: Avoid Resources directory
Performance: Preload commonly used shaders to avoid gameplay spikes and strip unused shaders
Performance: Try incremental Garbage Collector to reduce spikes*
Performance: Use indirect-referenced object pools to reduce spikes
GC: Control GC manually for fine control (advanced)
GC: Avoid garbage-generating methods such as FindObjectsOfType
GC: Aim for less than 32 bytes of memory allocations per frame
GC: Avoid C# boxing
BuildSize: Reduce build sizes with CDNs
Chapter 4: The Extended Unity Performance Checklist (91+ Tips)
So far I’ve given you a simplified version of The Unity Performance Checklist that plays well with the web.
But there’s much more to it than just a few titles…
What does each item really mean? And more importantly, what can we actually do about them?
Luckily, I spent a few hours preparing an extended version for you.
In the extended edition of The Unity Performance Checklist for 2020+, you’ll get access to a spreadsheet and a PDF that includes:
A growingcatalog of 91+ Unity Performance Tips
Descriptions: why is each suggestion relevant to you?
Onlinereferences with actionable steps to apply in your project
Get it below and then answer this question…
Which Unity performance checkboxes will you leave without a tick and why?