23 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

Improve performance

This page describes common performance problems and best practices for mitigating them.

Script computation

Expensive operations in Luau code take longer to process and can thus impact frame rate. Unless it is being executed in parallel, Luau code runs synchronously and blocks the main thread until it encounters a function that yields the thread.

Common problems

Mitigation

MicroProfiler scopes

Scope Associated computation
RunService.PreRender Code executing on the PreRender event
RunService.PreSimulation Code executing on the Stepped event
RunService.PostSimulation Code executing on Heartbeat event
RunService.Heartbeat Code executing on Heartbeat event

For more information on debugging scripts using the MicroProfiler, see the debug library, which includes functions for tagging specific code and further increasing specificity, such as debug.profilebegin and debug.profileend. Many Roblox API methods called by scripts also have their own associated MicroProfiler tags that can provide useful signal.

Script memory usage

Memory leaks can occur when you write scripts that consume memory that the garbage collector can't properly release when its no longer in use. Leaks are specifically pervasive on the server, because they can continuously be online for many days, whereas a client session is much shorter.

The following memory values in the Developer Console can indicate a problem that needs further investigation:

Common problems

Mitigation

To clean up all used values for preventing memory leaks:

Physics computation

Excessive physics simulation can be a key cause of increased computation time per frame on both the server and the client.

Common problems

Mitigation

MicroProfiler scopes

Scope Associated computation
physicsStepped Overall physics computation
worldStep Discrete physics steps taken each frame

Physics memory usage

Physics movement and collision detection consumes memory. Mesh parts have a CollisionFidelity property that determines the approach that's used to evaluate the collision bounds of the mesh.

Common problem

The default and precise collision detection modes consumes significantly more memory than the two other modes with lower fidelity collision shapes.

If you see high levels of memory consumption under PhysicsParts, you might need to explore reducing the collision fidelity of objects in your game.

How to mitigate

To reduce memory used for collision fidelity:

Humanoids

Humanoid is a class that provides a wide range of functionalities to player and non player characters (NPCs). Although powerful, a Humanoid comes with a significant computation cost.

Common problems

Mitigation

MicroProfiler scopes

Scope Associated computation
stepHumanoid Humanoid control and physics
stepAnimation Humanoid and animator animation
updateInvalidatedFastClusters Associated with instantiating or modifying an avatar

Rendering

A significant portion of the time the client spends each frame is on rendering the scene in the current frame. The server doesn't do any rendering, so this section is exclusive to the client.

Draw calls

A draw call is a set of instructions from the engine to the GPU to render something. Draw calls have significant overhead. Generally, the fewer draw calls per frame, the less computational time is spent rendering a frame.

You can see how many draw calls are currently occurring with the Render Stats ⟩ Timing item in Studio. You can view Render Stats in the client by pressing ShiftF2.

The more objects that need to be drawn in your scene in a given frame, the more draw calls are made to the GPU. However, the Roblox Engine utilizes a process called instancing to collapse identical meshes with the same texture characteristics into a single draw call. Specifically, multiple meshes with the same MeshContent are handled in a single draw call when:

Other common problems

Mitigation

Note

This might result in visual artifacts on shadows.

MicroProfiler scopes

Scope Associated computation
Prepare and Perform Overall rendering
Perform/Scene/computeLightingPerform Light grid and shadow updates
LightGridCPU Voxel light grid updates
ShadowMapSystem Shadow mapping
Perform/Scene/UpdateView Preparation for rendering and particle updates
Perform/Scene/RenderView Rendering and post processing

Networking and replication

Networking and replication describes the process by which data is sent between the server and connected clients. Information is sent between the client and server every frame, but larger amounts of information require more compute time.

Common problems

Mitigation

You can employ the following tactics to reduce unnecessary replication:

MicroProfiler scopes

Scope Associated computation
ProcessPackets Processing for incoming network packets, such as event invocations and property changes
Allocate Bandwidth and Run Senders Outgoing events relevant on servers

Asset memory usage

The highest impact mechanism available to creators to improve client memory usage is to enable instance streaming.

Instance streaming

Instance streaming selectively loads out parts of the data model that are not required, which can lead to considerably reduced load times and increase the client's ability to prevent crashes when it comes under memory pressure.

If you are encountering memory issues and have instance streaming disabled, consider updating your game to support it, particularly if your 3D world is large. Instance streaming is based on distance in 3D space, so larger worlds naturally benefit more from it.

If instance streaming is enabled, you can increase the aggressiveness of it. For example, consider:

For more information on streaming options and their benefits, see streaming properties.

Other common problems

Mitigation

Load times

Many games implement custom loading screens and use the ContentProvider:PreloadAsync() method to request assets so that images, sounds, and meshes are downloaded in the background.

The advantage of this approach is that it lets you ensure important parts of your game are fully loaded without pop-in. However, a common mistake is overutilizing this method to preload more assets than are actually required.

An example of a bad practice is loading the entire Workspace. While this might prevent texture pop-in, it significantly increases load times.

Another similar practice is utilising ContentProvider.RequestQueueSize to ensure that all requested assets have finished loading. However, this presents the same issue of significantly increased load times, while also being an unreliable method due to its fluctuating nature.

Instead, only use ContentProvider:PreloadAsync() in necessary situations, which include:

If you must load a large number of assets, we recommend you provide a Skip Loading button.