mirror of
https://github.com/BlackMATov/evolved.lua.git
synced 2025-12-13 03:29:08 +07:00
add defer spawn bmarks
This commit is contained in:
@@ -28,6 +28,21 @@ basics.describe_bench(string.format('Spawn Benchmarks: Simple Spawn | %d entitie
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Simple Defer Spawn | %d entities with 1 component', N),
|
||||
function()
|
||||
local spawn = evo.spawn
|
||||
|
||||
local components = { [F1] = true }
|
||||
|
||||
evo.defer()
|
||||
for _ = 1, N do
|
||||
spawn(components)
|
||||
end
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Simple Spawn | %d entities with 3 components', N),
|
||||
function()
|
||||
local spawn = evo.spawn
|
||||
@@ -41,6 +56,21 @@ basics.describe_bench(string.format('Spawn Benchmarks: Simple Spawn | %d entitie
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Simple Defer Spawn | %d entities with 3 components', N),
|
||||
function()
|
||||
local spawn = evo.spawn
|
||||
|
||||
local components = { [F1] = true, [F2] = true, [F3] = true }
|
||||
|
||||
evo.defer()
|
||||
for _ = 1, N do
|
||||
spawn(components)
|
||||
end
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Simple Spawn | %d entities with 5 components', N),
|
||||
function()
|
||||
local spawn = evo.spawn
|
||||
@@ -54,6 +84,21 @@ basics.describe_bench(string.format('Spawn Benchmarks: Simple Spawn | %d entitie
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Simple Defer Spawn | %d entities with 5 components', N),
|
||||
function()
|
||||
local spawn = evo.spawn
|
||||
|
||||
local components = { [F1] = true, [F2] = true, [F3] = true, [F4] = true, [F5] = true }
|
||||
|
||||
evo.defer()
|
||||
for _ = 1, N do
|
||||
spawn(components)
|
||||
end
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
print '----------------------------------------'
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Simple Spawn | %d entities with 1 required component', N),
|
||||
@@ -69,6 +114,21 @@ basics.describe_bench(string.format('Spawn Benchmarks: Simple Spawn | %d entitie
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Simple Defer Spawn | %d entities with 1 required component', N),
|
||||
function()
|
||||
local spawn = evo.spawn
|
||||
|
||||
local components = { [R1] = true }
|
||||
|
||||
evo.defer()
|
||||
for _ = 1, N do
|
||||
spawn(components)
|
||||
end
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Simple Spawn | %d entities with 3 required components', N),
|
||||
function()
|
||||
local spawn = evo.spawn
|
||||
@@ -82,6 +142,21 @@ basics.describe_bench(string.format('Spawn Benchmarks: Simple Spawn | %d entitie
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Simple Defer Spawn | %d entities with 3 required components', N),
|
||||
function()
|
||||
local spawn = evo.spawn
|
||||
|
||||
local components = { [R3] = true }
|
||||
|
||||
evo.defer()
|
||||
for _ = 1, N do
|
||||
spawn(components)
|
||||
end
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Simple Spawn | %d entities with 5 required components', N),
|
||||
function()
|
||||
local spawn = evo.spawn
|
||||
@@ -95,6 +170,21 @@ basics.describe_bench(string.format('Spawn Benchmarks: Simple Spawn | %d entitie
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Simple Defer Spawn | %d entities with 5 required components', N),
|
||||
function()
|
||||
local spawn = evo.spawn
|
||||
|
||||
local components = { [R5] = true }
|
||||
|
||||
evo.defer()
|
||||
for _ = 1, N do
|
||||
spawn(components)
|
||||
end
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
print '----------------------------------------'
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Builder Spawn | %d entities with 1 component', N),
|
||||
@@ -108,6 +198,19 @@ basics.describe_bench(string.format('Spawn Benchmarks: Builder Spawn | %d entiti
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Builder Defer Spawn | %d entities with 1 component', N),
|
||||
function()
|
||||
local builder = evo.builder():set(F1)
|
||||
|
||||
evo.defer()
|
||||
for _ = 1, N do
|
||||
builder:spawn()
|
||||
end
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Builder Spawn | %d entities with 3 components', N),
|
||||
function()
|
||||
local builder = evo.builder():set(F1):set(F2):set(F3)
|
||||
@@ -119,6 +222,19 @@ basics.describe_bench(string.format('Spawn Benchmarks: Builder Spawn | %d entiti
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Builder Defer Spawn | %d entities with 3 components', N),
|
||||
function()
|
||||
local builder = evo.builder():set(F1):set(F2):set(F3)
|
||||
|
||||
evo.defer()
|
||||
for _ = 1, N do
|
||||
builder:spawn()
|
||||
end
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Builder Spawn | %d entities with 5 components', N),
|
||||
function()
|
||||
local builder = evo.builder():set(F1):set(F2):set(F3):set(F4):set(F5)
|
||||
@@ -130,6 +246,19 @@ basics.describe_bench(string.format('Spawn Benchmarks: Builder Spawn | %d entiti
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Builder Defer Spawn | %d entities with 5 components', N),
|
||||
function()
|
||||
local builder = evo.builder():set(F1):set(F2):set(F3):set(F4):set(F5)
|
||||
|
||||
evo.defer()
|
||||
for _ = 1, N do
|
||||
builder:spawn()
|
||||
end
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
print '----------------------------------------'
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Builder Spawn | %d entities with 1 required component', N),
|
||||
@@ -143,6 +272,19 @@ basics.describe_bench(string.format('Spawn Benchmarks: Builder Spawn | %d entiti
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Builder Defer Spawn | %d entities with 1 required component', N),
|
||||
function()
|
||||
local builder = evo.builder():set(R1)
|
||||
|
||||
evo.defer()
|
||||
for _ = 1, N do
|
||||
builder:spawn()
|
||||
end
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Builder Spawn | %d entities with 3 required components', N),
|
||||
function()
|
||||
local builder = evo.builder():set(R3)
|
||||
@@ -154,6 +296,19 @@ basics.describe_bench(string.format('Spawn Benchmarks: Builder Spawn | %d entiti
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Builder Defer Spawn | %d entities with 3 required components', N),
|
||||
function()
|
||||
local builder = evo.builder():set(R3)
|
||||
|
||||
evo.defer()
|
||||
for _ = 1, N do
|
||||
builder:spawn()
|
||||
end
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Builder Spawn | %d entities with 5 required components', N),
|
||||
function()
|
||||
local builder = evo.builder():set(R5)
|
||||
@@ -165,6 +320,19 @@ basics.describe_bench(string.format('Spawn Benchmarks: Builder Spawn | %d entiti
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Builder Defer Spawn | %d entities with 5 required components', N),
|
||||
function()
|
||||
local builder = evo.builder():set(R5)
|
||||
|
||||
evo.defer()
|
||||
for _ = 1, N do
|
||||
builder:spawn()
|
||||
end
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
print '----------------------------------------'
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Multi Spawn | %d entities with 1 component', N),
|
||||
@@ -178,6 +346,19 @@ basics.describe_bench(string.format('Spawn Benchmarks: Multi Spawn | %d entities
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Multi Defer Spawn | %d entities with 1 component', N),
|
||||
function()
|
||||
local multi_spawn = evo.multi_spawn
|
||||
|
||||
local components = { [F1] = true }
|
||||
|
||||
evo.defer()
|
||||
multi_spawn(N, components)
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Multi Spawn | %d entities with 3 components', N),
|
||||
function()
|
||||
local multi_spawn = evo.multi_spawn
|
||||
@@ -189,6 +370,19 @@ basics.describe_bench(string.format('Spawn Benchmarks: Multi Spawn | %d entities
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Multi Defer Spawn | %d entities with 3 components', N),
|
||||
function()
|
||||
local multi_spawn = evo.multi_spawn
|
||||
|
||||
local components = { [F1] = true, [F2] = true, [F3] = true }
|
||||
|
||||
evo.defer()
|
||||
multi_spawn(N, components)
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Multi Spawn | %d entities with 5 components', N),
|
||||
function()
|
||||
local multi_spawn = evo.multi_spawn
|
||||
@@ -200,6 +394,19 @@ basics.describe_bench(string.format('Spawn Benchmarks: Multi Spawn | %d entities
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Multi Defer Spawn | %d entities with 5 components', N),
|
||||
function()
|
||||
local multi_spawn = evo.multi_spawn
|
||||
|
||||
local components = { [F1] = true, [F2] = true, [F3] = true, [F4] = true, [F5] = true }
|
||||
|
||||
evo.defer()
|
||||
multi_spawn(N, components)
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
print '----------------------------------------'
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Multi Spawn | %d entities with 1 required component', N),
|
||||
@@ -213,6 +420,19 @@ basics.describe_bench(string.format('Spawn Benchmarks: Multi Spawn | %d entities
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Multi Defer Spawn | %d entities with 1 required component', N),
|
||||
function()
|
||||
local multi_spawn = evo.multi_spawn
|
||||
|
||||
local components = { [F1] = true }
|
||||
|
||||
evo.defer()
|
||||
multi_spawn(N, components)
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Multi Spawn | %d entities with 3 required components', N),
|
||||
function()
|
||||
local multi_spawn = evo.multi_spawn
|
||||
@@ -224,6 +444,19 @@ basics.describe_bench(string.format('Spawn Benchmarks: Multi Spawn | %d entities
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Multi Defer Spawn | %d entities with 3 required components', N),
|
||||
function()
|
||||
local multi_spawn = evo.multi_spawn
|
||||
|
||||
local components = { [R3] = true }
|
||||
|
||||
evo.defer()
|
||||
multi_spawn(N, components)
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Multi Spawn | %d entities with 5 required components', N),
|
||||
function()
|
||||
local multi_spawn = evo.multi_spawn
|
||||
@@ -234,3 +467,16 @@ basics.describe_bench(string.format('Spawn Benchmarks: Multi Spawn | %d entities
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
basics.describe_bench(string.format('Spawn Benchmarks: Multi Defer Spawn | %d entities with 5 required components', N),
|
||||
function()
|
||||
local multi_spawn = evo.multi_spawn
|
||||
|
||||
local components = { [R5] = true }
|
||||
|
||||
evo.defer()
|
||||
multi_spawn(N, components)
|
||||
evo.commit()
|
||||
|
||||
evo.batch_destroy(Q1)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user