This commit is contained in:
aaron 2023-09-12 00:16:37 +01:00
parent 5b61a9df10
commit 5a458eae71
7 changed files with 52 additions and 48 deletions

View file

@ -1,18 +1,8 @@
local BENCH, START = require("test/testkit").benchmark()
-- try prevent inlining by wrapping in a closure referencing an upvalue that
-- cannot be determined at compile-time
local function NO_INLINE(fn)
local r = math.random()
return function(x)
local _ = r
fn(x)
end
end
local vide = require "src/init"
local N = 2^18 -- 262144[
local N = 2^18 -- 262144
BENCH("create state", function()
local source = vide.source
@ -153,6 +143,8 @@ BENCH("update binding", function()
end)
end)
N /= 1024
BENCH("indexes() no change", function()
local data = {}
@ -307,6 +299,8 @@ BENCH("values() all remove", function()
end)
end)
N *= 1024
BENCH("register new cleanup", function()
local cleanup = vide.cleanup