mirror of
https://github.com/luau-lang/luau.git
synced 2025-01-19 17:28:06 +00:00
67e9d85124
Some checks are pending
benchmark / callgrind (map[branch:main name:luau-lang/benchmark-data], ubuntu-22.04) (push) Waiting to run
build / macos (push) Waiting to run
build / macos-arm (push) Waiting to run
build / ubuntu (push) Waiting to run
build / windows (Win32) (push) Waiting to run
build / windows (x64) (push) Waiting to run
build / coverage (push) Waiting to run
build / web (push) Waiting to run
release / macos (push) Waiting to run
release / ubuntu (push) Waiting to run
release / windows (push) Waiting to run
release / web (push) Waiting to run
Implement RFC: 2-component vector constructor. This includes 2-component overload for `vector.create` and associated fastcall function, and its type definition. These features are controlled by a new feature flag `LuauVector2Constructor`. Additionally constant folding now supports two components when `LuauVector2Constants` feature flag is set. Note: this work does not include changes to CodeGen. Thus calls to `vector.create` with only two arguments are not natively compiled currently. This is left for future work.
14 lines
No EOL
451 B
Lua
14 lines
No EOL
451 B
Lua
local function prequire(name) local success, result = pcall(require, name); return success and result end
|
|
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
|
|
|
|
bench.runCode(function()
|
|
for i=1,1000000 do
|
|
vector.create(i, 2, 3)
|
|
vector.create(i, 2, 3)
|
|
vector.create(i, 2, 3)
|
|
vector.create(i, 2, 3)
|
|
vector.create(i, 2, 3)
|
|
end
|
|
end, "vector: create")
|
|
|
|
-- TODO: add more tests |