mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-10 22:00:54 +01:00
Add vector lib micro benchmark (just vector.create at this point)
This commit is contained in:
parent
21998aa342
commit
81488f1fe4
1 changed files with 14 additions and 0 deletions
14
bench/micro_tests/test_vector_lib.lua
Normal file
14
bench/micro_tests/test_vector_lib.lua
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
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
|
Loading…
Add table
Reference in a new issue