Skip to content
Merged

Dev #44

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
256 changes: 252 additions & 4 deletions README.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion develop/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
## Thoughts

- We should have a way to not copy components on deferred spawn/clone
- Having a light version of the gargabe collector can be useful for some use-cases
- Basic default component value as true looks awful, should we use something else?

## Known Issues
Expand Down
1 change: 1 addition & 0 deletions develop/all.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ require 'develop.testing.clone_tests'
require 'develop.testing.depth_tests'
require 'develop.testing.destroy_tests'
require 'develop.testing.locate_tests'
require 'develop.testing.lookup_tests'
require 'develop.testing.main_tests'
require 'develop.testing.mappers_tests'
require 'develop.testing.multi_spawn_tests'
Expand Down
72 changes: 36 additions & 36 deletions develop/benchmarks/clone_bmarks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -307,24 +307,24 @@ print '----------------------------------------'
basics.describe_bench(
string.format('Clone Benchmarks: Multi Clone | %d entities with 1 component', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [F1] = true }

multi_clone(N, prefab)
multi_clone_nr(N, prefab)

evo.batch_destroy(QF1)
end)

basics.describe_bench(
string.format('Clone Benchmarks: Multi Defer Clone | %d entities with 1 component', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [F1] = true }

evo.defer()
multi_clone(N, prefab)
multi_clone_nr(N, prefab)
evo.commit()

evo.batch_destroy(QF1)
Expand All @@ -333,36 +333,36 @@ basics.describe_bench(
basics.describe_bench(
string.format('Clone Benchmarks: Multi Clone With Defaults | %d entities with 1 component', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [D1] = true }

multi_clone(N, prefab)
multi_clone_nr(N, prefab)

evo.batch_destroy(QD1)
end)

basics.describe_bench(
string.format('Clone Benchmarks: Multi Clone | %d entities with 3 components', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [F1] = true, [F2] = true, [F3] = true }

multi_clone(N, prefab)
multi_clone_nr(N, prefab)

evo.batch_destroy(QF1)
end)

basics.describe_bench(
string.format('Clone Benchmarks: Multi Defer Clone | %d entities with 3 components', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [F1] = true, [F2] = true, [F3] = true }

evo.defer()
multi_clone(N, prefab)
multi_clone_nr(N, prefab)
evo.commit()

evo.batch_destroy(QF1)
Expand All @@ -371,36 +371,36 @@ basics.describe_bench(
basics.describe_bench(
string.format('Clone Benchmarks: Multi Clone With Defaults | %d entities with 3 components', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [D1] = true, [D2] = true, [D3] = true }

multi_clone(N, prefab)
multi_clone_nr(N, prefab)

evo.batch_destroy(QD1)
end)

basics.describe_bench(
string.format('Clone Benchmarks: Multi Clone | %d entities with 5 components', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [F1] = true, [F2] = true, [F3] = true, [F4] = true, [F5] = true }

multi_clone(N, prefab)
multi_clone_nr(N, prefab)

evo.batch_destroy(QF1)
end)

basics.describe_bench(
string.format('Clone Benchmarks: Multi Defer Clone | %d entities with 5 components', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [F1] = true, [F2] = true, [F3] = true, [F4] = true, [F5] = true }

evo.defer()
multi_clone(N, prefab)
multi_clone_nr(N, prefab)
evo.commit()

evo.batch_destroy(QF1)
Expand All @@ -409,11 +409,11 @@ basics.describe_bench(
basics.describe_bench(
string.format('Clone Benchmarks: Multi Clone With Defaults | %d entities with 5 components', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [D1] = true, [D2] = true, [D3] = true, [D4] = true, [D5] = true }

multi_clone(N, prefab)
multi_clone_nr(N, prefab)

evo.batch_destroy(QD1)
end)
Expand All @@ -423,24 +423,24 @@ print '----------------------------------------'
basics.describe_bench(
string.format('Clone Benchmarks: Multi Clone | %d entities with 1 required component', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [RF1] = true }

multi_clone(N, prefab)
multi_clone_nr(N, prefab)

evo.batch_destroy(QF1)
end)

basics.describe_bench(
string.format('Clone Benchmarks: Multi Defer Clone | %d entities with 1 required component', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [RF1] = true }

evo.defer()
multi_clone(N, prefab)
multi_clone_nr(N, prefab)
evo.commit()

evo.batch_destroy(QF1)
Expand All @@ -449,36 +449,36 @@ basics.describe_bench(
basics.describe_bench(
string.format('Clone Benchmarks: Multi Clone With Defaults | %d entities with 1 required component', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [RD1] = true }

multi_clone(N, prefab)
multi_clone_nr(N, prefab)

evo.batch_destroy(QD1)
end)

basics.describe_bench(
string.format('Clone Benchmarks: Multi Clone | %d entities with 3 required components', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [RF123] = true }

multi_clone(N, prefab)
multi_clone_nr(N, prefab)

evo.batch_destroy(QF1)
end)

basics.describe_bench(
string.format('Clone Benchmarks: Multi Defer Clone | %d entities with 3 required components', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [RF123] = true }

evo.defer()
multi_clone(N, prefab)
multi_clone_nr(N, prefab)
evo.commit()

evo.batch_destroy(QF1)
Expand All @@ -487,36 +487,36 @@ basics.describe_bench(
basics.describe_bench(
string.format('Clone Benchmarks: Multi Clone With Defaults | %d entities with 3 required components', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [RD123] = true }

multi_clone(N, prefab)
multi_clone_nr(N, prefab)

evo.batch_destroy(QD1)
end)

basics.describe_bench(
string.format('Clone Benchmarks: Multi Clone | %d entities with 5 required components', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [RF12345] = true }

multi_clone(N, prefab)
multi_clone_nr(N, prefab)

evo.batch_destroy(QF1)
end)

basics.describe_bench(
string.format('Clone Benchmarks: Multi Defer Clone | %d entities with 5 required components', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [RF12345] = true }

evo.defer()
multi_clone(N, prefab)
multi_clone_nr(N, prefab)
evo.commit()

evo.batch_destroy(QF1)
Expand All @@ -525,11 +525,11 @@ basics.describe_bench(
basics.describe_bench(
string.format('Clone Benchmarks: Multi Clone With Defaults | %d entities with 5 required components', N),
function()
local multi_clone = evo.multi_clone
local multi_clone_nr = evo.multi_clone_nr

local prefab = evo.spawn { [RD12345] = true }

multi_clone(N, prefab)
multi_clone_nr(N, prefab)

evo.batch_destroy(QD1)
end)
14 changes: 7 additions & 7 deletions develop/benchmarks/common_bmarks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ basics.describe_bench(string.format('Common Benchmarks: Evolved Entity Cycle | %
local prefab_a = evo.builder():prefab():set(world):set(a, 0):spawn()
local prefab_b = evo.builder():prefab():set(world):set(b, 0):spawn()

evo.multi_clone(N, prefab_a)
evo.multi_clone_nr(N, prefab_a)

evo.builder()
:set(world):group(world):query(query_a)
Expand Down Expand Up @@ -129,10 +129,10 @@ basics.describe_bench(string.format('Common Benchmarks: Evolved Simple Iteration
local query_cd = evo.builder():set(world):include(c, d):spawn()
local query_ce = evo.builder():set(world):include(c, e):spawn()

evo.multi_spawn(N, { [world] = true, [a] = 0, [b] = 0 })
evo.multi_spawn(N, { [world] = true, [a] = 0, [b] = 0, [c] = 0 })
evo.multi_spawn(N, { [world] = true, [a] = 0, [b] = 0, [c] = 0, [d] = 0 })
evo.multi_spawn(N, { [world] = true, [a] = 0, [b] = 0, [c] = 0, [e] = 0 })
evo.multi_spawn_nr(N, { [world] = true, [a] = 0, [b] = 0 })
evo.multi_spawn_nr(N, { [world] = true, [a] = 0, [b] = 0, [c] = 0 })
evo.multi_spawn_nr(N, { [world] = true, [a] = 0, [b] = 0, [c] = 0, [d] = 0 })
evo.multi_spawn_nr(N, { [world] = true, [a] = 0, [b] = 0, [c] = 0, [e] = 0 })

evo.builder()
:set(world):group(world):query(query_ab)
Expand Down Expand Up @@ -223,7 +223,7 @@ basics.describe_bench(string.format('Common Benchmarks: Evolved Packed Iteration
local query_d = evo.builder():set(world):include(d):spawn()
local query_e = evo.builder():set(world):include(e):spawn()

evo.multi_spawn(N, { [world] = true, [a] = 0, [b] = 0, [c] = 0, [d] = 0, [e] = 0 })
evo.multi_spawn_nr(N, { [world] = true, [a] = 0, [b] = 0, [c] = 0, [d] = 0, [e] = 0 })

evo.builder()
:set(world):group(world):query(query_a)
Expand Down Expand Up @@ -317,7 +317,7 @@ basics.describe_bench(string.format('Common Benchmarks: Evolved Fragmented Itera
local query_z = evo.builder():set(world):include(chars[#chars]):spawn()

for i = 1, #chars do
evo.multi_spawn(N, { [world] = true, [chars[i]] = i, [data] = i })
evo.multi_spawn_nr(N, { [world] = true, [chars[i]] = i, [data] = i })
end

evo.builder()
Expand Down
4 changes: 2 additions & 2 deletions develop/benchmarks/process_bmarks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ basics.describe_bench(string.format('Process Benchmarks: Evolved AoS Processing
local pf = evo.builder():set(wf):spawn()
local vf = evo.builder():set(wf):spawn()

evo.multi_spawn(N, {
evo.multi_spawn_nr(N, {
[wf] = true,
[pf] = { x = 0, y = 0, z = 0, w = 0 },
[vf] = { x = 0, y = 0, z = 0, w = 0 },
Expand Down Expand Up @@ -67,7 +67,7 @@ basics.describe_bench(string.format('Process Benchmarks: Evolved SoA Processing
local vzf = evo.builder():set(wf):spawn()
local vwf = evo.builder():set(wf):spawn()

evo.multi_spawn(N, {
evo.multi_spawn_nr(N, {
[wf] = true,
[pxf] = 0,
[pyf] = 0,
Expand Down
Loading
Loading