What is this "WaitForLock" in the MicroProfiler that's causing insane lag?


Greetings.
I am currently developing a Roblox game, and it’s all extremely lightweight. One issue that I am coming across that is impacting my performance is these occasional lagspikes, which can be originated to this mysterious “WaitForLock” entry in the MicroProfiler.
It doesn’t tell me what it’s doing or why, but it’s causing insane lag whenever it happens. I’m not constantly changing lighting settings, effects, or graphical settings, especially not on the serverside.

These logs are from a serverside run of my game. Where are these truly coming from, and how can I fix them?

1 Like

Experiencing this too.
Additional context: I’ve had studio open for a long time, maybe around 24 hours or more. (Seems to be irrelevant)

2 Likes

Sorry for the necro.
What are your PC specs; CPU, GPU, RAM and all? It looks like this could be limited to PCs with slow RAM/VRAM speeds (i.e. laptops with integrated graphics.) I’ve had reports that faster PCs don’t have issues with WaitForLock taking up too much frametime.

For reference, I have:

CPU: AMD Ryzen 5 4500U
GPU (integrated): RX Vega 6
RAM: 8GB DDR4-2666MHz
Storage: M.2 NVME SSD (relevant because of pagefiles)

I’ll try and investigate this further on a different machine (and probably OS.)