test: update atom bench

This commit is contained in:
Richard 2024-09-28 17:06:11 -07:00
parent 3074bf8323
commit 1501644a15

View file

@ -1,7 +1,7 @@
-- This file is for use by Benchmarker -- This file is for use by Benchmarker
-- https://boatbomber.itch.io/benchmarker -- https://boatbomber.itch.io/benchmarker
local Package = game:GetService("ReplicatedStorage").Packages.charm local Package = game:GetService("ReplicatedStorage").DevPackages.Charm
local atom = require(Package.atom) local atom = require(Package.atom)
local computed = require(Package.computed) local computed = require(Package.computed)
@ -11,19 +11,19 @@ local function parameterGenerator()
end end
local benchmarks = { local benchmarks = {
atom = function(_, source: any) atom = function(_, state: any)
for _ = 1, 500 do for _ = 1, 500 do
source(math.random(1, 2)) state(math.random(1, 2))
end end
end, end,
computed = function(_, source: any) computed = function(_, state: any)
computed(function() computed(function()
return 2 * source() return 2 * state()
end) end)
for _ = 1, 500 do for _ = 1, 500 do
source(math.random(1, 2)) state(math.random(1, 2))
end end
end, end,
} }