Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
MicroProfiler walkthrough
This walkthrough shows how to use the MicroProfiler to find a problematic aspect of a game and identify the root cause. Download the game, Open from File in Studio, and follow along.
Download the gameIdentify the issue
After you open the game in Studio, start testing it with F5 or the Play button.
The frame rate feels decent, but not as smooth as it should be for a game of this size and scope. Press CtrlShiftF5 (⌘ShiftF5) to show the Performance Summary overlay.

Note that the frame rate is below 60 frames per second (FPS).
Open the MicroProfiler by pressing CtrlAltF6 (⌘⌥F6).

Note that the frame times are consistent—the bars are roughly the same height—so whatever is causing the low frame rate is running every single frame as opposed to running occasionally and causing frame time spikes.
Pause the MicroProfiler by pressing CtrlP (⌘P). Pausing with the keyboard shortcut opens detailed mode.
Click and drag to pan the graph. Note how one particular task in the worker threads seems to be using a lot of processing time compared to the main thread. Hover over
RunService.Steppedand note how long it's taking to render.
Stacked bars in the timeline indicate a hierarchy of code, so keep hovering on lower and lower layers to try and identify the issue.


Note the
LocalScriptlabel, which indicates the name of the script, and theRaycastlabel, which indicates that the problem might be related to raycasting.
Create troubleshooting labels
Now that the MicroProfiler has provided a starting point, you can troubleshoot the problematic code.
Stop the play test and filter the Explorer window for
localscriptto find the file.
A search for
raycastindicates that this portion of code is probably the culprit for the game's poor performance:local RAYS_PER_SECOND = 1500 local function onStepped() for _ = 1, RAYS_PER_SECOND do local startPosition = getRandomPosition() local endPosition = getRandomPosition() local direction = endPosition - startPosition Workspace:Raycast( startPosition, endPosition ) end end RunService.Stepped:Connect(onStepped)Specifically, you can see that the code is casting 1,500 rays per second in random directions.
To verify that this portion of code is causing the rendering delay, wrap the contents of the function with
debug.profilebegin()anddebug.profileend():local function onStepped() debug.profilebegin("Raycast Spam") for _ = 1, RAYS_PER_SECOND do local startPosition = getRandomPosition() local endPosition = getRandomPosition() local direction = endPosition - startPosition Workspace:Raycast( startPosition, endPosition ) end debug.profileend() end
Confirm and fix the issue
Start testing the game, and open the MicroProfiler again.
Note how the MicroProfiler now shows the custom label, indicating that this function was indeed the root cause.
Stop the play test.
Delete or comment out the
onStepped()function and theRunService.Stepped:Connect(onStepped)connection.Start testing the game again, and check the Performance Summary again.

Note the huge improvement to frame rate and corresponding drop in frame times on the MicroProfiler graph.