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 从公开仓库中收录这些内容。

举报或申请下架