test: add benchmark update 1000->1 graph that updates only 1 dependency

This commit is contained in:
ernisto 2025-04-11 14:06:35 -03:00
parent eb75693a36
commit 71e59639c9

View file

@ -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)