Micro profiler: How to optimize?

Hey!
In my game, I’ve recently been getting these weird frame spikes and drops in my micro profiler sometimes. It usually results in a slight framedrop which is annoying.

The issue is that I have no idea how to fix these issues as the longest taking process appears to be some internal thing.

Bildschirmfoto 2025-04-26 um 17.24.13

As visible in the image, it looks to be some yield for the gpu.
But I have no idea how to make it take less time.

It would be great if anyone could help out!!!

1 Like

Are you able to attribute the lag spikes to any action that the player is doing? Or is there something else going on at the same time the lag spikes appear?

Is your game visually heavy / has a lot of parts that require good hardware?

Look at the other processes running at the lag spikes. Like is there anything else above / below on the same frame or on the entire lag spike area?

The player has very little to no action done. It’s also a relatively small map that should run decently. The rest of the frame’s occupation is really really small. These were the biggest performance eaters.

It’s notable that my game is a tower defense game and this spike really only occurred when enemies or towers were on the screen (for some reason). The thing is that both are heavily stress tested and usually run in quantity of hundreds without causing lag.