Assistance in understanding a Microprofiler dump

When playing my game, my FPS rates become low and unplayable. I’ve created a Microprofiler dump, but I’m not entirely sure what it means nor how to apply it. If someone could help that’d be great.

Microprofiler dump:

1 Like

Hey, I’m not sure how to read this. However, I can lend you some other advice for debugging your game.

Have you tried testing in Studio and looking at the Script Performance tab for the client and server? It shows you the percentages each script is running at, if anything is > 3% or so it might be worth checking into.

One other thing, unanchored parts on the server definitely bring down the performance of any game, despite how far away the player is from them. Not sure if that’s relevant in your case, but just something to check for.

Hope this helps. :slight_smile:

1 Like

Do unanchored parts still affect the player when they’re unloaded with streaming enabled?

It shouldn’t, from my understanding all parts out of range with streaming will be completely removed.


Yeah, those scripts are definitely chunking your performance.

I don’t mind looking over the code to those scripts if you want to debug this further. :slight_smile:

1 Like

Both of those scripts are responsible for the E to interact controls. Those scripts are vital and I’m not sure how they contribute to memory that much.

(had to delete scripts for obvious reasons)

1 Like

Alright so, I noticed a few things off the bat.

You don’t need to be using spawn at all, the code you’re running doesn’t even yield, so I see absolutely no need for that.


It probably isn’t a good idea to call :GetDescendants every tenth of a second, that could very well be chunking on client memory if you have a large number of instances in the game. You could either run that once initially, and update the table every few seconds if you absolutely need to.

Hope this helps :slight_smile:

1 Like

Yikes. I have no idea what happened, but after I removed all the spawn functions and the GetDescendants thing, both the studio play test and in-game crashed. When I removed these changes, it was back to normal again. I couldn’t even see what the issue was because it kept crashing.

(had to delete scripts for obvious reasons)

Comment out your .DescendantAdded event and see if it still crashes.

1 Like

It fixes it, but I’m not sure how I would change that so it doesn’t crash. I’ve also found that this also uses up quite a bit of memory:

while true do
	for i, v in pairs(workspace:GetDescendants()) do
		if v:IsA("Sound") and v.Name == "StereoSound" then
			v.Volume = 0

It’s probably because you’re calling :GetDescendants every 1/30 of a second, approx. That can be very expensive.

Perhaps you could try storing the objects as a dictionary, instead of calling :GetDescendants again when you really don’t need to. Here’s an example:

local objects = {}
--//When the player spawns in, call GetDescendants once to set up the dictionary.
for i, object in pairs(workspace:GetDescendants()) do
object[object] = object --//Store a new key as the object itself with itself as the value

objects[obj] = obj --//Add or replace existing key in the dictionary with the newly made object

An idea I had, untested but this logic may give you a performance increase. Hope it helps!

1 Like

In the output it says that it should be a string, not an instance. I’ve tried finding ways around it but I’ve been unsuccessful.

It should work?

Can you post what line of code is giving you the error?

The MicroProfiler Dump is very similar in functionality to the MicroProfiler built into the game client. It’s just that it doesn’t do live tracking of game performance, since it is a dump.

Here’s a small article on how it’s used.

1 Like

Just tested my logic to make sure I wasn’t feeding you incorrect syntax, and it worked.

Really puzzled by why it’s giving you that error.

Maybe add a print statement on top of that line-

1 Like

Seems to have fixed itself. Not sure what happened.