|
75 | 75 |
|
76 | 76 | print '----------------------------------------' |
77 | 77 |
|
| 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 | + |
78 | 134 | for _, P in ipairs(Ps) do |
79 | 135 | basics.describe_bench(string.format('Other Benchmarks: SystemWith1Component, %d padding | %d entities', P, N), |
80 | 136 | function(w) |
|
0 commit comments