mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 14:25:44 +08:00
23 lines
435 B
Lua
23 lines
435 B
Lua
|
local bench = script and require(script.Parent.bench_support) or require("bench_support")
|
||
|
|
||
|
bench.runCode(function()
|
||
|
for j=1,1e6 do
|
||
|
tonumber("42")
|
||
|
tonumber(42)
|
||
|
end
|
||
|
end, "tonumber")
|
||
|
|
||
|
bench.runCode(function()
|
||
|
for j=1,1e6 do
|
||
|
tostring(nil)
|
||
|
tostring("test")
|
||
|
tostring(42)
|
||
|
end
|
||
|
end, "tostring")
|
||
|
|
||
|
bench.runCode(function()
|
||
|
for j=1,1e6 do
|
||
|
tostring(j)
|
||
|
end
|
||
|
end, "tostring-gc")
|