Little profiler understanding help please

Trying to learn more how the profiler works.

Does this mean my scripts are taking up a ton of cpu? with it showing 30fps?
All the other cpu options I click on the left show like 250 or some 1000 etc…

You’ve set the profiler to only show the cost of the scripts. The profiler shows that it takes ~33ms, spiking up to ~66ms to run your scripts.

To run at 60fps, everything (including your scripts), has to take no more than 16ms, so you’re for sure overspending.

To figure out what’s taking long, set your profiler to hierarchy mode (it defaults to Timeline, which imo is a bit useless unless you’re debugging DOTS-stuff), click a frame, and sort by time (ms). That’ll show which of your scripts are taking a long time.

If you can’t understand why those scripts are taking long, profile again in deep profiler mode, so you can see what those scripts are spending time on.

2 Likes

Oh thanks a bunch. I’ll try that out. Ya that was my issue trying to figure out what is taking so long.

I have a blank scene where I spawn 1,000 characters but I deactivated them after spawn.
I’m getting like 1900 fps but I notice I get a huge spikes shown below for editorLoop.

If you can, you should profile builds, as they give a more accurate representation of how your game will run. The editor has a good bit of overhaed.