Roblox Performance

TabooHarmony/roblox-brain/skills/core/roblox-performance

作者 TabooHarmony38826be57ee37bcf023e9c2b85681bea3909281c無授權條款收錄於 2026年10月9日更新於 2026年10月9日

Use when profiling Roblox performance or diagnosing FPS, memory, network, mobile, or hot-path problems.

AI 產生的概覽

指導對 Roblox 遊戲效能進行剖析與診斷,涵蓋 FPS、記憶體、網路、行動裝置及熱點路徑問題。

功能
此技能提供用於剖析 Roblox 體驗並診斷效能問題的參考指引。內容涵蓋 MicroProfiler、開發者主控台與指令碼分析器等剖析工具,伺服器心跳、用戶端 FPS 與記憶體的效能目標,以及平行 Luau、熱迴圈成本、物件池、StreamingEnabled 和行動裝置注意事項。它是僅含說明的技能,並指向一份包含程式碼範例與 API 表的更完整參考文件。
適用情境
在剖析 Roblox 效能,或診斷 FPS、記憶體、網路、行動裝置或熱點路徑問題時使用。它面向效能預算與以量測為基礎的最佳化工作,而非一般遊戲邏輯指令碼撰寫。
執行需求
不附帶指令碼,僅為說明內容。它引用了一份額外的模型可讀文件 references/full.md。除代理本身外,不需要認證、套件或執行環境。

Roblox Performance

When to Load

Use for profiling and performance budgets. Pooling and lifecycle patterns: roblox-luau-patterns.

Quick Reference

Profiling Tools

  • MicroProfiler (Ctrl+F6): Frame breakdown of scripts, physics, rendering.
  • Developer Console (F9): Memory, network, rendering, and server stats.
  • Script Profiler (Ctrl+Alt+F5): Per-script CPU and heap.
  • Labels: debug.profilebegin/debug.profileend mark regions; debug.setmemorycategory labels memory. Gate instrumentation behind a flag.

Performance Targets

MetricStarting targetInvestigate at
Server heartbeat< 16ms> 33ms
Client FPS (desktop)60< 30
Client FPS (mobile)45< 30
Memorydevice-specificsustained growth

Optimize measured hot paths, not folklore. Throttle from measurements; re-profile after shipping.

Parallel Luau

  • Use Actors only after profiling identifies isolatable CPU work.
  • Workers compute; synchronize before restricted DataModel writes.
  • Do not rely on shared module state across Actors. SendMessage copies data; SharedTable supports shared state and atomic updates.

Hot-loop cost model

  • Luau optimizes global imports; avoid folklore function hoisting/unrolling. Environment impurity can disable optimizations. Profile allocations as well as CPU; GC cost may occur later.

Object Pooling

Pre-clone and reuse. 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, shadows on low-end devices.

Full reference with code examples and API tables: references/full.md [blocked]

來源與署名

來源:TabooHarmony/roblox-brain位於skills/core/roblox-performance提交38826be

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架