roblox-performance
БесплатноБез исполняемых скриптовНе проверенUse when optimizing a Roblox game for better frame rates, reducing lag, improving server or client performance, diagnosing FPS drops, handling large worlds…
от sentinelcore★ 32 звезды на GitHubОб этом скилле
Roblox Performance Optimization
Quick Reference
| Technique | Impact | When to Use |
|---|---|---|
| StreamingEnabled | High | Large open worlds |
| Object pooling | High | Frequent spawn/destroy |
| Cache references outside loops | High | Heartbeat/RenderStepped |
task.wait() over wait() |
Medium | All scripts |
| MeshParts over Unions | Medium | Many unique shapes |
| LOD (hide at distance) | Medium | Complex models |
| Anchor static parts | Medium | Reduce physics budget |
| Limit PointLights | High | Any scene with many lights |
StreamingEnabled
Enable for large worlds — engine sends only nearby parts to the client.
-- Studio: Workspace > StreamingEnabled = true
workspace.StreamingEnabled = true
workspace.StreamingMinRadius = 64
workspace.StreamingTargetRadius = 128
- 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:
workspace:RequestStreamAroundAsync(targetPosition, 5) -- 5s timeout
Hot-Path Loop Optimization
RunService.Heartbeat and RenderStepped fire every frame (~60×/sec). Keep them lean.
Bad — searching the hierarchy every frame
RunService.Heartbeat:Connect(function()
local char = workspace:FindFirstChild(player.Name)
local humanoid = char and char:FindFirstChild("Humanoid")
if humanoid then humanoid.WalkSpeed = 16 end
end)
Good — cache references once, do work only when needed
local humanoid = nil
Players.LocalPlayer.CharacterAdded:Connect(function(char)
humanoid = char:WaitForChild("Humanoid")
end)
RunService.Heartbeat:Connect(function(dt)
if not humanoid then return end
humanoid.WalkSpeed = 16 -- cached reference, no search
end)
Rules:
- Cache
game:GetService()and part references outside the loop. - Never call
FindFirstChild,GetChildren, orGetDescendantsinside Heartbeat. - Throttle work that doesn't need every frame:
local TICK_INTERVAL = 0.5
local elapsed = 0
RunService.Heartbeat:Connect(function(dt)
elapsed += dt
if elapsed < TICK_INTERVAL then return end
elapsed = 0
-- expensive work here, runs 2×/sec instead of 60×/sec
end)
task Library vs Legacy Scheduler
Always use task — wait() and spawn() throttle under load and are deprecated.
| Legacy | Modern |
|---|---|
wait(n) |
task.wait(n) |
spawn(fn) |
task.spawn(fn) |
delay(n, fn) |
task.delay(n, fn) |
coroutine.wrap(fn)() |
task.spawn(fn) |
Object Pooling
Reuse instances instead of creating and destroying them every frame.
-- ObjectPool ModuleScript
local ObjectPool = {}
ObjectPool.__index = ObjectPool
function ObjectPool.new(template, initialSize)
local self = setmetatable({ _template = template, _available = {} }, ObjectPool)
for i = 1, initialSize do
local obj = template:Clone()
obj.Parent = nil
table.insert(self._available, obj)
end
return self
end
function ObjectPool:Get(parent)
local obj = table.remove(self._available) or self._template:Clone()
obj.Parent = parent
return obj
end
function ObjectPool:Return(obj)
obj.Parent = nil
table.insert(self._available, obj)
end
return ObjectPool
-- Usage
local pool = ObjectPool.new(ReplicatedStorage.Bullet, 20)
local function fireBullet(origin)
local bullet = pool:Get(workspace)
bullet.CFrame = CFrame.new(origin)
task.delay(3, function() pool:Return(bullet) end)
end
Level of Detail (LOD)
Built-in: Set Model.LevelOfDetail = Automatic — engine merges distant parts into an imposter mesh automatically.
Manual distance-based LOD:
-- LocalScript
local INTERVAL = 0.2
local LOD_DISTANCE = 150
local elapsed = 0
RunService.Heartbeat:Connect(function(dt)
elapsed += dt
if elapsed < INTERVAL then return end
elapsed = 0
local dist = (workspace.CurrentCamera.CFrame.Position - model.PrimaryPart.Position).Magnitude
local visible = dist < LOD_DISTANCE
for _, v in model:GetDescendants() do
if v:IsA("BasePart") then
v.LocalTransparencyModifier = visible and 0 or 1
end
end
end)
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:
RunService.Heartbeat:Connect(function()
de
Установить roblox-performance в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл roblox-performance?
Use when optimizing a Roblox game for better frame rates, reducing lag, improving server or client performance, diagnosing FPS drops, handling large worlds, or when asked about streaming, draw calls, object pooling, LOD, MicroProfiler, or expensive loop operations.
Как установить скилл roblox-performance?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл roblox-performance запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic