Skip to content

Commit e7705dc

Browse files
committed
funny bmarks from other frameworks (multisystem)
1 parent dd4c718 commit e7705dc

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

develop/benchmarks/other_bmarks.lua

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,62 @@ end
7575

7676
print '----------------------------------------'
7777

78+
basics.describe_bench(string.format('Other Benchmarks: MultiSystem | %d entities', N),
79+
function(w)
80+
evo.process(w)
81+
end, function()
82+
local w = evo.builder()
83+
:set(evo.DESTRUCTION_POLICY, evo.DESTRUCTION_POLICY_DESTROY_ENTITY)
84+
:build()
85+
86+
local third = math.floor(N / 3)
87+
88+
for _ = 1, third do
89+
evo.spawn({ [w] = true, [f1] = 0 })
90+
end
91+
92+
for _ = 1, third do
93+
evo.spawn({ [w] = true, [f2] = 0 })
94+
end
95+
96+
for _ = 1, N - 2 * third do
97+
evo.spawn({ [w] = true, [f1] = 1, [f2] = 2 })
98+
end
99+
100+
evo.builder():set(w):group(w):include(f1)
101+
:execute(function(chunk, _, entity_count)
102+
local f1s = chunk:components(f1)
103+
104+
for i = 1, entity_count do
105+
f1s[i] = f1s[i] + 1
106+
end
107+
end):build()
108+
109+
evo.builder():set(w):group(w):include(f2)
110+
:execute(function(chunk, _, entity_count)
111+
local f2s = chunk:components(f2)
112+
113+
for i = 1, entity_count do
114+
f2s[i] = f2s[i] + 1
115+
end
116+
end):build()
117+
118+
evo.builder():set(w):group(w):include(f1, f2)
119+
:execute(function(chunk, _, entity_count)
120+
local f1s, f2s = chunk:components(f1, f2)
121+
122+
for i = 1, entity_count do
123+
f1s[i] = f1s[i] + f2s[i]
124+
end
125+
end):build()
126+
127+
return w
128+
end, function(w)
129+
evo.destroy(w)
130+
end)
131+
132+
print '----------------------------------------'
133+
78134
for _, P in ipairs(Ps) do
79135
basics.describe_bench(string.format('Other Benchmarks: SystemWith1Component, %d padding | %d entities', P, N),
80136
function(w)

0 commit comments

Comments
 (0)