Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch storage strategy #87

Merged
merged 95 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
cfa85ac
initial files
memorycode Jul 14, 2024
1ba2008
delete unused file
memorycode Jul 14, 2024
208a7a9
assign an id to components
memorycode Jul 15, 2024
141f6d4
start query
memorycode Jul 15, 2024
87459d8
start keeping track of owned entities
memorycode Jul 15, 2024
847b5e5
store size of entities array
memorycode Jul 15, 2024
6468685
turn compatibleArchetypes into an array
memorycode Jul 15, 2024
49eebfa
correctly ID archetypes so we don't keep creating them for each entity
memorycode Jul 15, 2024
97999b6
move jecs to a binary model
memorycode Jul 15, 2024
205d5d4
clean up types
memorycode Jul 15, 2024
e85f5d8
add spawn, despawn, and insert commands
memorycode Jul 16, 2024
a3dfe88
start remove command
memorycode Jul 16, 2024
7ecc772
add remove command
memorycode Jul 16, 2024
1945388
get all world tests passing
memorycode Jul 16, 2024
7986fd8
remove idea of multiple storages
memorycode Jul 16, 2024
db171d5
remove the idea of oldStorage from transitionArchetype
memorycode Jul 16, 2024
eb72ef6
Merge branch 'main' into buffer-commands
memorycode Jul 16, 2024
6206863
rename defer methods
memorycode Jul 16, 2024
18c9473
fix world tests to account for command queue
memorycode Jul 16, 2024
76a2a7c
make loop tests pass
memorycode Jul 16, 2024
0b5bec4
remove outdated loop test
memorycode Jul 16, 2024
67f62c9
fix ci
memorycode Jul 16, 2024
1e1d74e
add docs
memorycode Jul 16, 2024
5d4f9ae
handle error in commit
memorycode Jul 17, 2024
9cc4523
add replace command
memorycode Jul 18, 2024
134aa83
pass arguments to systems
memorycode Jul 18, 2024
8dc8803
remove old comments
memorycode Jul 18, 2024
8bb9749
polish
memorycode Jul 18, 2024
0bdf946
remove comments
memorycode Jul 18, 2024
6edeee2
clear commands when we clear the world
memorycode Jul 18, 2024
9c2d830
allow multiple worlds
memorycode Jul 21, 2024
020cd76
address review comments
memorycode Jul 22, 2024
24b4a61
validate arguments closer to source
memorycode Jul 22, 2024
1fdcb82
add more tests
memorycode Jul 23, 2024
500d3cd
track entities that are marked for deletion
memorycode Jul 23, 2024
00faa15
update changelog
memorycode Jul 23, 2024
f39172a
remove prints
memorycode Jul 23, 2024
a267037
remove commented out code
memorycode Jul 23, 2024
6b1d1b7
apply reviewed changes
memorycode Jul 23, 2024
2fceafe
apply feedback from review
memorycode Jul 27, 2024
e822b4b
add test for correct size while deferring
memorycode Jul 27, 2024
a5a942f
remove entity from old archetype
memorycode Jul 27, 2024
e47dc79
update debug labels
memorycode Jul 30, 2024
848883c
Merge branch 'main' into buffer-commands
Ukendio Aug 3, 2024
4d4c40c
fix error formatting
memorycode Aug 7, 2024
4c1ebf1
remove old benchmark project
memorycode Aug 9, 2024
3d775bc
Merge branch 'main' into use-real-archetypes
memorycode Aug 9, 2024
70f32b9
Merge branch 'buffer-commands' into use-real-archetypes
memorycode Aug 9, 2024
33cb077
try to collapse archetype changes into one method
memorycode Aug 10, 2024
4a7740d
try to handle only single insertions
memorycode Aug 11, 2024
f8a613c
move entities from old archetype to new archetype
memorycode Aug 11, 2024
241b0dc
add component removal
memorycode Aug 11, 2024
f5d80d0
smarter insertions
memorycode Aug 11, 2024
70a4d84
cache references to component storage in queries
memorycode Aug 12, 2024
55cc4e7
add despawning
memorycode Aug 12, 2024
30fbfea
fix get not using component id
memorycode Aug 12, 2024
6698ebc
add :without
memorycode Aug 12, 2024
7b38999
add world iterator
memorycode Aug 12, 2024
c7b4c51
track changed and replace
memorycode Aug 12, 2024
7517122
fix empty query edge cases
memorycode Aug 13, 2024
6fb750d
remove unused archetype transition fn
memorycode Aug 13, 2024
aa9d869
fix overwriting on insert creating invalid archetype
memorycode Aug 13, 2024
d4980d7
map archetype ids to archetypes
memorycode Aug 13, 2024
0c3b507
do not transition archetype on removal if same
memorycode Aug 13, 2024
1e87a7a
allow query length up to 6
memorycode Aug 13, 2024
1893c77
add snapshots and fix replace
memorycode Aug 13, 2024
778fd19
remove dead code
memorycode Aug 16, 2024
343de5e
Merge branch 'main' into use-real-archetypes
memorycode Aug 28, 2024
2c0f945
Revert "Merge branch 'main' into use-real-archetypes"
memorycode Aug 28, 2024
f886f1a
Merge branch 'main' into use-real-archetypes
memorycode Aug 28, 2024
3197ca2
Fix some issues introduced in merge
memorycode Aug 28, 2024
a743d60
Fix more merge issues
memorycode Aug 28, 2024
50861c3
Fix changelog
memorycode Aug 28, 2024
4fd00c8
Fix README version change
memorycode Aug 28, 2024
b6b2c2e
Merge branch 'main' into use-real-archetypes
jackTabsCode Oct 3, 2024
097ab69
add basic archetype tree
memorycode Oct 4, 2024
e9231d9
implement findArchetypes
memorycode Oct 4, 2024
82b2cb1
update benchmark
memorycode Oct 4, 2024
eccc15b
make tests pass
memorycode Oct 4, 2024
4609bf8
add more components to stress test
memorycode Oct 4, 2024
0b461d6
improve query perf
memorycode Oct 4, 2024
9a61bed
fix typo
memorycode Oct 4, 2024
a7f8ecd
add archetype deletion
memorycode Oct 5, 2024
11319a2
Add cleanup to tree
memorycode Oct 20, 2024
b5d68f9
Remove archetype tree
memorycode Oct 20, 2024
a2cf6cb
Add back most world operation validators
memorycode Oct 20, 2024
4cbf907
Remove strict directive
memorycode Oct 20, 2024
fd9b4a6
Merge branch 'main' into use-real-archetypes
memorycode Oct 20, 2024
2a8a862
Fix lints
memorycode Oct 20, 2024
ce8e048
Add within tags
memorycode Oct 20, 2024
e4db549
Update pinned Matter to 0.8.4
memorycode Oct 21, 2024
4f99c66
Update doc comments
memorycode Oct 21, 2024
1abb8d7
Pass query to without
memorycode Oct 21, 2024
0d30a67
Try to make Moonwave happy
memorycode Oct 21, 2024
e914bdf
Replace debugger getEntity call
memorycode Oct 21, 2024
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
Binary file added PinnedJecs.rbxm
Binary file not shown.
Binary file added PinnedMatter.rbxm
Binary file not shown.
32 changes: 32 additions & 0 deletions bench.project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "Benchmark Suite",
"tree": {
"$className": "DataModel",
"StarterPlayer": {
"$className": "StarterPlayer",
"StarterPlayerScripts": {
"$className": "StarterPlayerScripts",
"$path": "tests"
}
},
"ReplicatedStorage": {
"$className": "ReplicatedStorage",
"$path": "DevPackages",
"Matter": {
"$path": "lib"
},
"PinnedMatter": {
"$path": "PinnedMatter.rbxm"
},
"Jecs": {
"$path": "PinnedJecs.luau"
memorycode marked this conversation as resolved.
Show resolved Hide resolved
}
},
"ServerStorage": {
"$className": "ServerStorage",
"Benchmarks": {
"$path": "benchmarks"
}
}
}
}
memorycode marked this conversation as resolved.
Show resolved Hide resolved
51 changes: 51 additions & 0 deletions benchmarks/query.bench.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
--!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Jecs = require(ReplicatedStorage.Jecs)
local Matter = require(ReplicatedStorage.Matter)
local OldMatter = require(ReplicatedStorage.PinnedMatter)

local jecsWorld = Jecs.World.new()
local matterWorld = Matter.World.new()
local oldWorld = OldMatter.World.new()

local mA, mB = Matter.component(), Matter.component()
local oldA, oldB = OldMatter.component(), OldMatter.component()
local jA, jB = jecsWorld:component(), jecsWorld:component()

for i = 1, 10_000 do
matterWorld:spawnAt(i, mA({}), mB({}))
oldWorld:spawnAt(i, oldA({}), oldB({}))

local jecsEntity = jecsWorld:entity()
jecsWorld:set(jecsEntity, jA, {})
jecsWorld:set(jecsEntity, jB, {})
end

return {
ParameterGenerator = function()
return
end,

Functions = {
["New Matter"] = function(Profiler)
local count = 0
for entityId in matterWorld:query(mA, mB) do
count += 1
end
end,
["Old Matter"] = function(Profiler)
local count = 0
for entityId in oldWorld:query(oldA, oldB) do
count += 1
end
end,
["Jecs"] = function(Profiler)
local count = 0
for entityId in jecsWorld:query(jA, jB) do
count += 1
end
end,
},
}
Loading
Loading