ecs: switch from ArrayList per-table-per-component-set -> single-[]u8-per-table #338
No reviewers
Labels
No labels
CI
all
basisu
blog
bug
build
contributor-friendly
core
correctness
deferred
dev
direct3d-headers
docs
driver-os-issue
duplicate
dxcompiler
editor
examples
experiment
feature-idea
feedback
flac
freetype
gamemode
gkurve
glfw
gpu
gpu-dawn
harfbuzz
help welcome
in-progress
infrastructure
invalid
libmach
linux-audio-headers
long-term
mach
mach.gfx
mach.math
mach.physics
mach.testing
model3d
needs-triage
object
opengl-headers
opus
os/linux
os/macos
os/wasm
os/windows
package-manager
priority
proposal
proposal-accepted
question
roadmap
slipped
stability
sysaudio
sysgpu
sysjs
validating-fix
vulkan-zig-generated
wayland-headers
website
wontfix
wrench
www
x11-headers
xcode-frameworks
zig-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hexops/mach!338
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "sg/ecs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This switches our ECS over to manually managed memory (one
[]u8per archetype table, with multiple column arrays packed into it - dealing with padding/alignment ourselves) rather than the prior 1ArrayList(Component)per component in an archetype table.There is no change in the user-facing API yet, the goal of this change is just to get to manually managed memory. There are some things that are not entirely optimal because of this that I will explore in future PRs.
This idea was discussed in depth in #ecs:matrix.org (thanks Levy!) Notable advantages from my POV:
ErasedComponentStorageinterface, which is nice.ArrayListhas: slice ptr+len+capacity integers per component array per tableArrayListtoo, but now it's more likely the allocation are larger and thus more reusable by future archetype tables.) This could be quite important because one can imagine ending up with many small archetype tables.Overall seems like the right thing to do, so we're doing it.