Loading...
Loading...
Use for Luau performance work focused on profiling hotspots, allocation-aware code structure, table and iteration costs, builtin and function-call fast paths, compiler/runtime optimization behavior, and environment constraints that change execution speed.
npx skill4agent add stackfox-labs/luau-skills luau-performancegetfenvsetfenvloadstringluau-coreluau-typesroblox/*table.createfor k, v in t doipairsnilmath.max(x, y)string.byte(s, 1)local function__index__indexgetfenvsetfenvloadstringreferences/luau-performance-guide.mdreferences/profiling-guide.mdreferences/runtime-and-compiler-optimization-notes.mdreferences/library-performance-sensitive-patterns.mdmathstringtablereferences/sandbox-constraints-relevant-to-runtime-behavior.mdgetfenvsetfenvloadstringtable.createpairsipairsobj:Method()getfenvlocal function buildSquares(count)
local result = table.create(count)
for i = 1, count do
result[i] = i * i
end
return result
endlocal function clamp01(x)
return math.min(math.max(x, 0), 1)
end__indexlocal Counter = {}
Counter.__index = Counter
function Counter.new(step)
return setmetatable({
value = 0,
step = step,
}, Counter)
end
function Counter:advance()
self.value += self.step
return self.value
endlocal function magnitude2(x, y)
return math.sqrt(x * x + y * y)
end
return magnitude2