From 0f1f708827f16300d79f3f9d6270f238f54da9f0 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Fri, 3 Jan 2025 03:37:15 +0700 Subject: [PATCH] update bench results --- develop/unbench.lua | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/develop/unbench.lua b/develop/unbench.lua index edc8dd5..1b6c4ed 100644 --- a/develop/unbench.lua +++ b/develop/unbench.lua @@ -48,6 +48,22 @@ local function __bench_describe(name, loop, init) collectgarbage('collect') end +---@param tables table[] +__bench_describe('create and destroy 1k tables', function(tables) + for i = 1, 1000 do + local t = {} + tables[i] = t + end + + for i = 1, #tables do + tables[i] = nil + end + + collectgarbage('collect') +end, function() + return {} +end) + ---@param entities evolved.id[] __bench_describe('create and destroy 1k entities', function(entities) local id = evo.id @@ -188,3 +204,29 @@ end) | create and destroy 1k entities with three components ... | PASS | us: 574.71 | op/s: 1740.00 | kb/i: 0.14 ]] + +--- +--- hook flags for chunks +--- + +--[[ lua 5.1 +| create and destroy 1k entities ... | + PASS | us: 255.40 | op/s: 3915.42 | kb/i: 0.04 +| create and destroy 1k entities with one component ... | + PASS | us: 1005.03 | op/s: 995.00 | kb/i: 0.41 +| create and destroy 1k entities with two components ... | + PASS | us: 1747.83 | op/s: 572.14 | kb/i: 0.59 +| create and destroy 1k entities with three components ... | + PASS | us: 2576.92 | op/s: 388.06 | kb/i: 1.08 +]] + +--[[ luajit 2.1 +| create and destroy 1k entities ... | + PASS | us: 12.20 | op/s: 81940.30 | kb/i: 0.00 +| create and destroy 1k entities with one component ... | + PASS | us: 53.66 | op/s: 18636.82 | kb/i: 0.02 +| create and destroy 1k entities with two components ... | + PASS | us: 357.02 | op/s: 2801.00 | kb/i: 0.09 +| create and destroy 1k entities with three components ... | + PASS | us: 533.33 | op/s: 1875.00 | kb/i: 0.15 +]]