Recently, I noticed that code with the native comment (and attribute) is running at the same speed as interpreted O2.
Code used for testing:
--!optimize 2
local function sumComponentsSlow(v)
return v.X + v.Y + v.Z
end
local function sumComponentsFast(v: vector)
return v.X + v.Y + v.Z
end
local N = 10_000_000
x = 1
local v = vector.create(x, x, x)
local t0 = os.clock()
local sumA = 0
for i = 1, N do
sumA += sumComponentsSlow(v)
end
local slowTime = os.clock() - t0
local t1 = os.clock()
local sumB = 0
for i = 1, N do
sumB += sumComponentsFast(v)
end
local fastTime = os.clock() - t1
print("untyped", slowTime)
print("typed", fastTime)
print(version())
We do not have any direct influence over the fast flag configuration you use in standalone Luau, or any non-Roblox Luau runtime. So, there isn’t a mechanism by which we could dynamically disable it.
Was this fixed for release 731, and if not will it be fixed on July 29th? I am not seeing it in the update notes and I am unable to test as I have been busy, but I know it was causing issues for some of my QA testers.