Roblox Performance
When to Load
Use when profiling, diagnosing lag, or setting performance budgets. For code-level micro-optimizations (pooling, throttling, relevance filtering, lazy loading) load roblox-luau-patterns; this skill measures and tunes the engine.
Quick Reference
Profiling Tools
- MicroProfiler (Ctrl+F6): Per-frame breakdown: scripts, physics, rendering. Primary tool for finding what's slow.
- Developer Console (F9): Stats tab: memory, network, render stats. Server Stats for server-side metrics.
- Script Profiler (Ctrl+Alt+F5): Per-script CPU usage and heap allocations.
Performance Targets
| Metric |
Starting target |
Investigate at |
| Server heartbeat |
< 16ms |
> 33ms |
| Client FPS (desktop) |
60 |
< 30 |
| Client FPS (mobile) |
45 |
< 30 |
| Memory |
device-specific |
sustained growth |
"Expensive" means the profiler shows it on a hot frame path (raycasts, clones, large finds, replication-heavy writes). Throttle by judgment from measurements, not a universal number, and re-measure after shipping: profile before and after on representative devices and confirm the targeted metric moved without regressions. Micro-optimizations live in roblox-luau-patterns.
Parallel Luau
- Use Actors only after profiling identifies isolatable CPU work.
- Workers compute; synchronize before restricted DataModel writes.
- SharedTable and mutexes add coordination cost; they do not replace ownership boundaries.
Object Pooling
-- Pre-clone, reuse. get() returns a lease token; release() requires it,
-- so duplicate or foreign releases never re-list the object.
local obj, lease = pool:get()
-- ... use obj ...
pool:release(obj, lease)
Canonical pool code (token-lease ownership): roblox-luau-patterns.
StreamingEnabled Essentials
- On by default. Container-scoped: only Workspace descendants stream.
ModelStreamingBehavior = Improved streams non-BasePart descendants with their parent Model; Legacy streams only BaseParts.
- Streamed-out = parented to nil, not destroyed. Luau refs persist if it streams back.
- Config (Studio): target defaults 1024, min 64; set
StreamingIntegrityMode; tune from data.
- Gotcha:
FindFirstChild("DistantPart") returns nil if streamed out. Use WaitForChild with timeout.
Mobile
- Profile geometry, textures, particles, UI, and shadows on low-end devices.
Full reference with code examples and API tables: references/full.md
1---2name: roblox-performance3description: Use when profiling Roblox performance or diagnosing FPS, memory, network, mobile, or hot-path problems.4---56# Roblox Performance78## When to Load910Use when profiling, diagnosing lag, or setting performance budgets. For code-level micro-optimizations (pooling, throttling, relevance filtering, lazy loading) load `roblox-luau-patterns`; this skill measures and tunes the engine.1112## Quick Reference1314### Profiling Tools15- **MicroProfiler (Ctrl+F6)**: Per-frame breakdown: scripts, physics, rendering. Primary tool for finding what's slow.16- **Developer Console (F9)**: Stats tab: memory, network, render stats. Server Stats for server-side metrics.17- **Script Profiler (Ctrl+Alt+F5)**: Per-script CPU usage and heap allocations.1819### Performance Targets20| Metric | Starting target | Investigate at |21|--------|-----------------|----------------|22| Server heartbeat | < 16ms | > 33ms |23| Client FPS (desktop) | 60 | < 30 |24| Client FPS (mobile) | 45 | < 30 |25| Memory | device-specific | sustained growth |2627"Expensive" means the profiler shows it on a hot frame path (raycasts, clones, large finds, replication-heavy writes). Throttle by judgment from measurements, not a universal number, and re-measure after shipping: profile before and after on representative devices and confirm the targeted metric moved without regressions. Micro-optimizations live in `roblox-luau-patterns`.2829### Parallel Luau30- Use Actors only after profiling identifies isolatable CPU work.31- Workers compute; synchronize before restricted DataModel writes.32- SharedTable and mutexes add coordination cost; they do not replace ownership boundaries.3334### Object Pooling35```luau36-- Pre-clone, reuse. get() returns a lease token; release() requires it,37-- so duplicate or foreign releases never re-list the object.38local obj, lease = pool:get()39-- ... use obj ...40pool:release(obj, lease)41```42Canonical pool code (token-lease ownership): `roblox-luau-patterns`.4344### StreamingEnabled Essentials45- **On by default**. Container-scoped: only Workspace descendants stream. `ModelStreamingBehavior = Improved` streams non-BasePart descendants with their parent Model; Legacy streams only BaseParts.46- **Streamed-out = parented to nil**, not destroyed. Luau refs persist if it streams back.47- **Config (Studio)**: target defaults 1024, min 64; set `StreamingIntegrityMode`; tune from data.48- **Gotcha**: `FindFirstChild("DistantPart")` returns nil if streamed out. Use WaitForChild with timeout.4950### Mobile51- Profile geometry, textures, particles, UI, and shadows on low-end devices.5253> Full reference with code examples and API tables: [references/full.md](references/full.md)