Skip to content

Commit

Permalink
use components not entities
Browse files Browse the repository at this point in the history
  • Loading branch information
Ukendio committed Sep 17, 2024
1 parent bd187e6 commit ca00d4c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions benches/general.luau
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ do TITLE "create"
end
end)

local A, B = world:entity(), world:entity()
local A = world:component()
local B = world:component()

BENCH("pair", function()
for i = 1, START(N) do
Expand Down Expand Up @@ -100,8 +101,10 @@ end
do TITLE "get"

local world = jecs.World.new()
local A, B, C, D = world:entity(), world:entity(), world:entity(), world:entity()

local A = world:component()
local B = world:component()
local C = world:component()
local D = world:component()
local entities = table.create(N)

for i = 1, N do
Expand Down Expand Up @@ -141,7 +144,10 @@ do TITLE "target"

BENCH("1st target", function()
local world = jecs.World.new()
local A, B, C, D = world:entity(), world:entity(), world:entity(), world:entity()
local A = world:component()
local B = world:component()
local C = world:component()
local D = world:component()
local entities = table.create(N)

for i = 1, N do
Expand Down Expand Up @@ -170,6 +176,7 @@ do TITLE(`query {N} entities`)
local function view_bench(n: number)
BENCH(`{n} entities per archetype`, function()
local world = jecs.World.new()

local A = world:component()
local B = world:component()
local C = world:component()
Expand Down

0 comments on commit ca00d4c

Please sign in to comment.