charm/tests/benchmarks/atom.bench.luau
richard e9d8dffb02
build: remove project json files (#46)
* build: remove project json files

Including Rojo project files in packages interferes with certain Wally packages that depend on roblox-ts packages

* build: create project files for release
2025-03-09 15:33:04 -07:00

30 lines
544 B
Text

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Charm = require(ReplicatedStorage.DevPackages.charm)
local computed = Charm.computed
local atom = Charm.atom
return {
ParameterGenerator = function() end,
Functions = {
atom = function()
local state = atom(0)
for _ = 1, 500 do
state(math.random(1, 2))
end
end,
computed = function()
local state = atom(0)
local _double = computed(function()
return 2 * state()
end)
for _ = 1, 500 do
state(math.random(1, 2))
end
end,
},
}