Basic

July 8 2020

0 comments

Profiling Can Now Be As Smooth As Silk

By Rubén Torres Bonet

July 8, 2020


__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"6c4de":{"name":"Main Accent","parent":-1},"67ed2":{"name":"Accent Dark","parent":"6c4de","lock":{"saturation":1}}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"6c4de":{"val":"var(--tcb-skin-color-0)"},"67ed2":{"val":"rgb(59, 65, 63)","hsl_parent_dependency":{"h":160,"l":-0.05,"s":0.04}}},"gradients":[]},"original":{"colors":{"6c4de":{"val":"rgb(51, 190, 127)","hsl":{"h":152,"s":0.57,"l":0.47}},"67ed2":{"val":"rgb(59, 65, 63)","hsl_parent_dependency":{"h":160,"s":0.04,"l":0.24}}},"gradients":[]}}]}__CONFIG_colors_palette__

Choose one thing to do at the same time:

  • Profile your game
  • OR work on the editor.

Why choose?

Because profiling AND using the editor at the same time will generate hiccups and ruin your profiling session. And you don't want to start all over again.

So often enough, you just idle in front of the profiler waiting for the moment you wanted to capture all along.

And do not dare touch the editor. Forget about compiling, importing textures or clicking anywhere. That will only bring unpleasant news.

You see, neither waiting nor endless profiling is any fun.

But that no more.

Since Unity 2020.1, you can launch the Unity profiler in standalone mode so you finally can:

  • Make the profiling process much more stable.
  • Work on the Unity editor while you profile, without affecting each other's performance levels.
  • Reduce noise that the Unity Profiler generates in your play-in-editor profiled data.

What's the Unity Standalone Profiler?

Since Unity 2020.1, we now have the option to start the profiler as a standalone process.

This means, the Unity editor and the unity profiler will run in different processes so they don't block each other. In other words, the OS will give you more mercy.

This is useful for you because running the profiler logic adds considerable overhead to your game session. And that noise isn't pleasant to hear.

Just think of parsing performance metrics, drawing them and handling the expensive user interaction through charts, tables and filters. Any of that will worsen the performance of the editor and hence of the profiler (and your game, if you're running it in the editor).

Here are the two biggest benefits of running the unity profiler in standalone mode:

  • Remove the propagation of hiccups between the unity editor (plus its running game) and the profiler.
  • Reduce the baseline cost of the profiler added to your in-editor running game.

The solution is very simple since Unity 2020.1.

It's just waiting for you to press the right button.

How to Run the Unity Standalone Profiler

Launching the profiler in standalone mode is straightforward.

This option is located at Window -> Analysis -> Profiler (Standalone)

Unity Profiler: Launching Standalone Mode

Unity Profiler: Launching Standalone Mode

Unity will greet you with a nice pop-up to sell you on the benefits of using the standalone unity profiler.

Unity Profiler: Standalone Mode Confirmation

Unity Profiler: Standalone Mode Confirmation

Like the warning says, it will take a few seconds to launch the profiler in standalone mode.

Once the loading completes, you'll see that the profiler spawns in a completely different window.

Unity Profiler: Standalone Mode

Unity Profiler: Standalone Mode

And it includes its own console. Yummy!

As much as I'd like to give you more information than that, that's all about it.

No bells, no whistles.

Everything works as usual and you're ready to go.

Should I Use the Unity Standalone Profiler?

Personally, I avoid using the standalone profiler when possible, mainly because it adds an extra window and it takes longer to load.

However, I found the standalone unity profiler especially useful in two cases:

  • When my clients use heavy plugins from the store that execute expensive code on the editor and randomly creates hiccups.
  • When I want to do useful work on the editor during long profiling sessions.

No matter what, the key is to be aware of the problems caused by running the profile in the same process as the unity editor.

If you need to avoid these performance problems, then running the unity profiler in standalone mode will help you there.

As always, keep this tool in your growing tool shelf and use when it helps.

Are There More Tricks to Work On My Game Performance?

Yeah, you'll find more of these neat performance tricks in my Unity Performance Checklist.

Go ahead and grab your copy.

~Ruben

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Rubén Torres Bonet

About the author

Born Game Developer, now ready to help you develop better games. Primary programmer on Star Trek Bridge Crew (Oculus Quest), Diamond Dash. Programmer on Time Stall, Catan Universe, Anne Frank House VR, Jelly Splash, Blackguards Definitive Edition. I also worked in minor XR experiences for HoloLens and Vive for clients such as Audi and Volkswagen.

You might also like

The Bright Side of Ray-Traced Global Illumination in Unity
>