How to start using the profiler in Unity

It is almost impossible find out what is affecting performance in your game without using a profiler. Luckily Unity comes with one built in. Let’s go over the basics of how to use it.

You find the profiler under Window->Analysis. Open the window and dock it:

By default the profiler is set to Timeline and have Deep Profile disabled. Change Timeline to Hierarchy and enable Deep Profile:

When you click on Play the profiler starts recording the performance of each frame. If you click on a frame on the profile graph the game will automatically pause and you can start to analyse that frame. You can easily analyse any other recorded frame by flicking on another part of the graph:

You can enable or disable the specific type you want to analyse by clicking on the type:

To make it easier to spot issues in the frame, sort by either Total %, GC alloc or Time ms:

To find out what specific part is causing the issue click on the arrow to expand until you get to final part. In this example you can see that there is an issue with the update function in the Inventory script:

Good luck!




Unity / C# Game developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

People of Hack Capital: Fayez, Full Stack Software Engineer

End To End Testing Additive Manufacturing Software


4 steps for getting better at problem solving

Docker For Beginners: How to build your first container

Getting Started with AWS on Rust

How we made TensorFlow run on a Raspberry Pi using Rust

Host your own Website for FREE

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Niklas Bergstrand

Niklas Bergstrand

Unity / C# Game developer

More from Medium

MALIGNANT film review

Danny’s R.E.M. Rank-a-thon

GM Frens! With the clock ticking for the token sale we would like to make sure everyone is up to…

The Story…Is The Art: Part II