Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions benchmark/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module benchmark
go 1.23.0

require (
github.com/akmonengine/volt v1.0.3
github.com/akmonengine/volt v1.1.0
github.com/mlange-42/arche v0.13.2
github.com/unitoftime/ecs v0.0.2-0.20240727195554-03fbb2d998cf
)

require github.com/unitoftime/cod v0.0.0-20230616173404-085cf4fe3918 // indirect

replace github.com/akmonengine/volt v1.0.3 => ./../../volt
replace github.com/akmonengine/volt v1.1.0 => ./../.
20 changes: 10 additions & 10 deletions benchmark/volt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
func BenchmarkCreateEntityVolt(b *testing.B) {
for i := 0; i < b.N; i++ {
world := volt.CreateWorld(ENTITIES_COUNT)
volt.RegisterComponent[testTransform](world, &volt.ComponentConfig[testTransform]{ID: testTransformId})
volt.RegisterComponent[testTag](world, &volt.ComponentConfig[testTag]{ID: testTagId})
volt.RegisterComponent[testTransform](world, &volt.ComponentConfig[testTransform]{})
volt.RegisterComponent[testTag](world, &volt.ComponentConfig[testTag]{})

for j := range ENTITIES_COUNT {
volt.CreateEntityWithComponents2(world, strconv.Itoa(j),
Expand All @@ -32,8 +32,8 @@ func BenchmarkIterateVolt(b *testing.B) {
b.StopTimer()

world := volt.CreateWorld(ENTITIES_COUNT)
volt.RegisterComponent[testTransform](world, &volt.ComponentConfig[testTransform]{ID: testTransformId})
volt.RegisterComponent[testTag](world, &volt.ComponentConfig[testTag]{ID: testTagId})
volt.RegisterComponent[testTransform](world, &volt.ComponentConfig[testTransform]{})
volt.RegisterComponent[testTag](world, &volt.ComponentConfig[testTag]{})

for i := 0; i < ENTITIES_COUNT; i++ {
id := world.CreateEntity(strconv.Itoa(i))
Expand All @@ -56,8 +56,8 @@ func BenchmarkIterateConcurrentlyVolt(b *testing.B) {
b.StopTimer()

world := volt.CreateWorld(ENTITIES_COUNT)
volt.RegisterComponent[testTransform](world, &volt.ComponentConfig[testTransform]{ID: testTransformId})
volt.RegisterComponent[testTag](world, &volt.ComponentConfig[testTag]{ID: testTagId})
volt.RegisterComponent[testTransform](world, &volt.ComponentConfig[testTransform]{})
volt.RegisterComponent[testTag](world, &volt.ComponentConfig[testTag]{})

for i := 0; i < ENTITIES_COUNT; i++ {
id := world.CreateEntity(strconv.Itoa(i))
Expand Down Expand Up @@ -86,8 +86,8 @@ func BenchmarkAddVolt(b *testing.B) {
b.StopTimer()

world := volt.CreateWorld(ENTITIES_COUNT)
volt.RegisterComponent[testTransform](world, &volt.ComponentConfig[testTransform]{ID: testTransformId})
volt.RegisterComponent[testTag](world, &volt.ComponentConfig[testTag]{ID: testTagId})
volt.RegisterComponent[testTransform](world, &volt.ComponentConfig[testTransform]{})
volt.RegisterComponent[testTag](world, &volt.ComponentConfig[testTag]{})

entities := make([]volt.EntityId, 0, ENTITIES_COUNT)
for j := range ENTITIES_COUNT {
Expand Down Expand Up @@ -115,8 +115,8 @@ func BenchmarkRemoveVolt(b *testing.B) {
b.StopTimer()

world := volt.CreateWorld(ENTITIES_COUNT)
volt.RegisterComponent[testTransform](world, &volt.ComponentConfig[testTransform]{ID: testTransformId})
volt.RegisterComponent[testTag](world, &volt.ComponentConfig[testTag]{ID: testTagId})
volt.RegisterComponent[testTransform](world, &volt.ComponentConfig[testTransform]{})
volt.RegisterComponent[testTag](world, &volt.ComponentConfig[testTag]{})

entities := make([]volt.EntityId, 0, ENTITIES_COUNT)
for j := range ENTITIES_COUNT {
Expand Down