mirror of
https://github.com/littensy/charm.git
synced 2026-10-22 21:01:38 +00:00
test: update atom bench
This commit is contained in:
parent
3074bf8323
commit
1501644a15
1 changed files with 6 additions and 6 deletions
|
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue