Skip to content

Commit

Permalink
Update pinned Matter to 0.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
memorycode committed Oct 21, 2024
1 parent ce8e048 commit e4db549
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion benchmark.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"$path": "lib"
},
"PinnedMatter": {
"$path": "pinned/Matter_0_8_3.rbxm"
"$path": "pinned/Matter_0_8_4.rbxm"
}
},
"ServerStorage": {
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/insert.bench.luau
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ return {
end,

Functions = {
["New"] = function(_, world)
["Matter 0.9"] = function(_, world)
for i = 1, N do
world:insert(i, A({ i }))
end
end,
["Old"] = function(_, _, world)
["Matter 0.8.4"] = function(_, _, world)
for i = 1, N do
world:insert(i, A({ i }))
end
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/next.bench.luau
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ return {
end,

Functions = {
["New Matter"] = function()
["Matter 0.9"] = function()
local query = world:query(A, B)
for _ = 1, 1_000 do
query:next()
end
end,
["Old Matter"] = function()
["Matter 0.8.4"] = function()
local query = pinnedWorld:query(pinnedA, pinnedB)
for _ = 1, 1_000 do
query:next()
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/query.bench.luau
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ return {
end,

Functions = {
["New Matter"] = function()
["Matter 0.9"] = function()
local count = 0
for _ in world:query(A, B) do
count += 1
end
end,
["Old Matter"] = function()
["Matter 0.8.4"] = function()
local count = 0
for _ in pinnedWorld:query(pinnedA, pinnedB) do
count += 1
Expand Down
13 changes: 6 additions & 7 deletions benchmarks/stress.bench.luau
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ local function flip()
end

local archetypes = {}
for i = 1, 1_000 do
for i = 1, 30_000 do
local id = i
world:spawnAt(id)
pinnedWorld:spawnAt(id)
Expand Down Expand Up @@ -69,18 +69,17 @@ for i = 1, 1_000 do
if flip() then
world:insert(id, G({ g = true, id = i }))
pinnedWorld:insert(id, pinnedG({ g = true, id = i }))
str ..= "G_"
str ..= "G"
end

archetypes[str] = (archetypes[str] or 0) + 1
end

local total = 0
for _, count in archetypes do
total += count
for _ in archetypes do
total += 1
end

print("archetypes:", archetypes)
print(total, "different archetypes")

return {
Expand All @@ -89,13 +88,13 @@ return {
end,

Functions = {
["Old Matter"] = function()
["Matter 0.8.4"] = function()
local count = 0
for _ in pinnedWorld:query(pinnedB, pinnedA) do
count += 1
end
end,
["New Matter"] = function()
["Matter 0.9"] = function()
local count = 0
for _ in world:query(B, A) do
count += 1
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/without.bench.luau
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ return {
end,

Functions = {
["Old Matter"] = function()
["Matter 0.8.4"] = function()
local count = 0
for _ in pinnedWorld:query(pinnedB):without(pinnedC) do
count += 1
end
end,
["New Matter"] = function()
["Matter 0.9"] = function()
local count = 0
for _ in world:query(B):without(C) do
count += 1
Expand Down
Binary file removed pinned/Matter_0_8_3.rbxm
Binary file not shown.
Binary file added pinned/Matter_0_8_4.rbxm
Binary file not shown.

0 comments on commit e4db549

Please sign in to comment.