Increasement of "CPU Time" causes lag spikes

So, in my game I am experiencing lag spikes every couple of minutes for like 1 seconds. I have absolutely no clue how they originate but those are hte micro-profiler informations once such spike happens:

2024-08-24_00h25_15

This is how it looks normally:

2024-08-24_00h25_22

Do you know where this could come from? Have a good day! :slight_smile:

1 Like

I would also like to note that the script performance is as usual during such lag spike. Everything in my game is anchored / I haven’t added anythign un-anchored when those started to appear. The weird thign is, I have even reverted the update by removing some features I’ve added with it and those lag spikes still occur.

Does this happen on other devices?

On every device, yes. Let me add some more so it goes through the word limit.

Okay, interesting. Hover over “Mode” in the microprofiler toolbar and select Detailed. Then, click back onto any of the frames in the top bar graph thingy.

Ah, I left the game already but I will do that and send a screenshot once I experience such lag spike again.

1 Like

Alright. Also, click on pause in the microprofiler toolbar when the lag spike happens so it doesn’t go away. Once you’ve done that, you can zoom in with the scroll wheel and the bars will represent how much time each task is taking.

1 Like




I don’t really know if these pictures help you figuring this problem out. :sob:

This is a really deep scroll in.

Interesting, maybe a lot of UI is updated? Sorry for the lack of punctual replies, I have not got notifications on.

Have you got any BillboardGUIs in your game, perhaps? Or just updating lots of UI elements at once?

We do have leaderboards, yes. I can see if they produce the lag spikes once they reset. Should I do that?

Ah wait. We don’t really have billboard UI’s. We just use Surface UIS except like 3 cases. Those have all a max distance tho.

1 Like

Btw, I have tested the leaderboards and they do not cuase the lag. The game’s micro profiler during the reset of the leaderboards is as usual, not laggy.

How strange. I looked through related bug reports and they’re all about BillboardGUIs. Have you verified that every BillboardGUI (even if not under Workspace or adorned to anything) has a max distance?

1 Like

You can also try ensuring that clipping is enabled on them:

1 Like

Thanks for reporting this issue @DivScripts !

Would you be able to share a repro placefile in a DM please? This would help us debug the issue.

It looks like UpdateUILayouts is taking >100ms, which looks like a bug on our end.

2 Likes

Of course, I will do that right now. THank you for helpin gme fixing that issue! :pray:

1 Like