From 81488f1fe4ade85ea60d743da5081ae25bb6adaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petri=20H=C3=A4kkinen?= Date: Tue, 17 Dec 2024 10:51:30 +0200 Subject: [PATCH] Add vector lib micro benchmark (just vector.create at this point) --- bench/micro_tests/test_vector_lib.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 bench/micro_tests/test_vector_lib.lua diff --git a/bench/micro_tests/test_vector_lib.lua b/bench/micro_tests/test_vector_lib.lua new file mode 100644 index 00000000..59bddc04 --- /dev/null +++ b/bench/micro_tests/test_vector_lib.lua @@ -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 \ No newline at end of file