Arche v0.6.0
🚀 Arche v0.6.0 features fast batch entity creation and deletion, cached filters, and many internal optimizations. 🚀
Highlights
- Batch creation and deletion of entities, with up to 4x and 10x speedup, respectively. Even more when combined with
World.Reset()
. - Cached filters for handling many archetypes and complex queries without slowdown.
- A lot of internal performance optimizations.
Breaking changes
- Generic mappers do no longer return all components when creating entities or components (#145)
- Resources API moved out of the world, to a helper to get by
World.Resources()
(#150) World.Reset()
does no longer remove the component change listener (#157)- Removes methods
filter.ALL.Not()
andfilter.ANY.Not()
, useNoneOf()
andAnyNot()
instead (#160) - World listener function takes a pointer to the
EntityEvent
instead of a copy as argument (#162)
Features
- Adds method
World.Reset()
, to allow for more efficient systematic simulations (#138) - Adds
World.Batch()
helper for performing optimized batch-creation and batch-removal of entities (#149) - Adds method
Mask.Exclusive()
to create a filter matching an exact component composition (#149, #188) - Generic mappers (
Map1
, ...) have methodsNewEntities
,NewEntitiesWith
andRemoveEntities
for batch operations (#151) - Batch-creation methods (ID-based and generic) have variants like
NewEntitiesQuery
that return a query over the created entities (#152) - Notification during batch-creation is delayed until the resp. query is closed (#157)
- Batch-remove methods (
RemoveEntities()
) return the number of removed entities (#173) - Filters can be cached and tracked by the
World
to speed up queries when there are many archetypes (#178) - Function
AddResource[T](*World)
returns the ID of the resource (#183)
Performance
- Speedup of archetype mask checks by 10% by checking mask before empty archetype (#139)
- Speedup of generic queries and mappers to come closer to ID-based access (#144)
- Speedup of archetype mask checks by casting filter interface to concrete type when possible (#148)
- Optimized batch creation of entities (#159)
- More efficiently clear the memory of removed components, with 2-3x speedup (#165)
- Do not clear memory when adding entities to archetypes, not required anymore as of #147 (#165)
- Speed up copying entity to archetype by getting entity pointer without reflection (#166)
- Avoid slice allocations in generic mapper methods (#170)
- Avoid type checks in query when iterating archetypes (#179)
- Speed up counting entities in queries with a cached filter (#182)
- Implements a fast and memory-efficient lookup data structure for components ID keys, to reduce the memory footprint of archetypes and the archetype graph (#192)
- Speedup of archetype creation by 40% by using a
const
for archetype storage page sizes (#197)
Bugfixes
- Archetype storage buffers are "zeroed" when removing entities, to allow GC on pointers and slices in components (#147)
- Use slices instead of arrays inside paged archetype list to ensure pointer persistence (#184)
Documentation
- Adds an example for batch-creation and batch-removal of entities (#173)
- Adds code examples to most public types, methods and functions (#183, #189)