jecs/benches/visual/spawn.bench.luau
Marcus d1d5b1f207
Add entity ranges (#221)
* Add component registration and metadata API

* Fix test case erroring

* Initial commit

* Simplify entity swap logic in world_entity function

* Allow to disconnect signals

* Remove appending to array

* Add ecs_assert and fix entity range handling

* Fix listener array indexing in observers

* Only max_id and alive_count if range_begin is larger than built in
ranges

* No nullable records

* Index is not a stable pointer
2025-04-25 23:53:39 +02:00

33 lines
543 B
Text

--!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local jecs = require(ReplicatedStorage.Lib:Clone())
local mirror = require(ReplicatedStorage.mirror:Clone())
return {
ParameterGenerator = function()
local ecs = jecs.world()
ecs:range(1000, 20000)
local mcs = mirror.World.new()
return ecs, mcs
end,
Functions = {
Mirror = function(_, ecs, mcs)
for i = 1, 100 do
mcs:entity()
end
end,
Jecs = function(_, ecs, mcs)
for i = 1, 100 do
ecs:entity()
end
end,
},
}