mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
This commit is contained in:
parent
5b61a9df10
commit
5a458eae71
7 changed files with 52 additions and 48 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue