mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
test: add benchmark update 1000->1 graph that updates only 1 dependency
This commit is contained in:
parent
eb75693a36
commit
71e59639c9
1 changed files with 20 additions and 3 deletions
|
|
@ -135,8 +135,25 @@ ROOT_BENCH("update 1->1->1->1...1000 graph", function()
|
|||
end
|
||||
end)
|
||||
|
||||
-- todo: why does it hang at 1k? it didn't before
|
||||
ROOT_BENCH("update 500->1 graph", function()
|
||||
ROOT_BENCH("update 1000->1 graph", function()
|
||||
local srcs = {}
|
||||
for i = 1, 1000 do
|
||||
srcs[i] = source(0)
|
||||
end
|
||||
|
||||
derive(function()
|
||||
for i = 1, 1000 do
|
||||
srcs[i]()
|
||||
end
|
||||
return false
|
||||
end)
|
||||
|
||||
for idx = 1, START(1000) do
|
||||
srcs[idx](idx)
|
||||
end
|
||||
end)
|
||||
|
||||
ROOT_BENCH("update all parents of 500->1 graph", function()
|
||||
local srcs = {}
|
||||
for i = 1, 500 do
|
||||
srcs[i] = source(0)
|
||||
|
|
@ -156,7 +173,7 @@ ROOT_BENCH("update 500->1 graph", function()
|
|||
end
|
||||
end)
|
||||
|
||||
ROOT_BENCH("update 1000->1 graph (batched)", function()
|
||||
ROOT_BENCH("update all parents of 1000->1 graph (batched)", function()
|
||||
local srcs = {}
|
||||
for i = 1, 1000 do
|
||||
srcs[i] = source(0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue