How to optimize CPU utilization

How to optimize CPU utilization. I’ve been following the latest docs to no avail. My CPU active time is multiple times higher than it should be and I simply have no idea how to reduce it. Everyone says “obviously just go to the profiler” but the profiler just blames player loop and editor loop. There is no profiling the editor loop, and when I try to profile the player loop, all I get is HDRenderPipeline.Render() at a whopping 32.9% (36.26 ms).

I’m starting to question my intelligence. I can make a game but I can’t optimize it? What are people supposed to do???

Have you tried profiling your game outside of the editor’s Play mode, using a build instead? Running a Development Build will provide much more accurate results than profiling in Play mode, since the measurements won’t be affected by the editor’s overhead.

The link you shared points to one of Unity’s performance e-books, but before diving into that, you should first read the official documentation: https://docs.unity3d.com/6000.0/Documentation/Manual/Profiler.html

You’ll also want to check out the docs on profiling a game after building it for your target device: https://docs.unity3d.com/6000.0/Documentation/Manual/profiling-target-device.html

Based on the results you gather, you can then explore the rest of the documentation (deep profiling, CPU performance, memory etc.)

Thanks so much for the swift reply! I have tried in a build but I have received the same results, specifically in the Late Update loop (Post Late Update, Finish Frame Rendering, HDRenderPipeline.Render(). The build seems to lag less when
A) I pause the profiler
B) I let the game run for a while
C) animations get far away

This may be related to rendering optimization. Try disabling certain features and observe how it affects the frame rate, for example, turn off post-processing, lights, or specific game objects, or adjust the quality settings and measure the impact.

You can also try minimizing draw calls. If you’re using the old UI system, split canvases into those that change and those that remain static. Additionally, work on reducing overdraw. Test these adjustments to see if any changes improves the performance.

With just the camera and the canvas - 45 FPS
With Characters enabled: -15 FPS
With Environment enabled: -25 FPS
With all 3 enabled: -10 - 15 FPS

This is on very low settings. The biggest performance impact I’ve seen is when I disabled shadows for the directional light in the scene.

What are your system specs? Perhaps your machine just isn’t suitable to run HDRP projects OR the assets and/or number of them in the scene are simply too many and/or of too high quality.

Knowing HDRP, it could also be a single setting or two that was cranked up far beyond what’s reasonable since HDRP allows settings/features beyond what current hardware is capable of in order to make it suitable for non-realtime rendering (eg cinematics).

My specs are pretty good, I get really good FPS on other scenes (30-40) but this scene in particular is dropping to half of that. I can play really demanding games and my RAM isn’t impacted at all, I don’t even have CPU problems when running programs.
So I am certain it is SOME unity setting, but I have no clue what it is or how to diagnose it.