Roblox Performance Optimization
Quick Reference
StreamingEnabled
Enable for large worlds — engine sends only nearby parts to the client.
- Parts outside the radius are
nilon the client — always guard withif part then. - Set
Model.LevelOfDetail = Disabledon models that must always be present. - Pre-stream an area before a cutscene or teleport:
Hot-Path Loop Optimization
RunService.Heartbeat and RenderStepped fire every frame (~60×/sec). Keep them lean.
Bad — searching the hierarchy every frame
Good — cache references once, do work only when needed
Rules:
- Cache
game:GetService()and part references outside the loop. - Never call
FindFirstChild,GetChildren, orGetDescendantsinside Heartbeat. - Throttle work that doesn't need every frame:
task Library vs Legacy Scheduler
Always use task — wait() and spawn() throttle under load and are deprecated.
Object Pooling
Reuse instances instead of creating and destroying them every frame.
Level of Detail (LOD)
Built-in: Set Model.LevelOfDetail = Automatic — engine merges distant parts into an imposter mesh automatically.
Manual distance-based LOD:
Reducing Draw Calls
- Merge parts that share a material into one MeshPart (export from Blender as
.fbx). - MeshParts batch better than CSG Unions (Unions re-triangulate at runtime).
- Reuse materials — 10 parts sharing
SmoothPlasticcosts far less than 10 unique textures. - Use
TextureIdon a single MeshPart instead of stacking Decals on many parts.
Profiling with MicroProfiler
- Press
Ctrl+F6in-game to open MicroProfiler. - Press
Ctrl+Pto pause and inspect a single frame. - Look for wide bars in
heartbeatSignal(Lua),physicsStepped(physics), orrender(GPU). - Label your own code:


