Astra
High-performance archetype ECS for modern C++.
C++20·v3.1.0·MIT
A billion iterations a second.
Operations per second over 10K to 1M entities, by how many components each query touches.
Intel Core i7 — 20 cores @ 3.6 GHz · Cache-optimized — L1/L2/L3 friendly · Modern C++20 — Zero-overhead abstractions
Built for the cache.
Storage, queries and memory designed around how the CPU actually reads data, with the seams a real engine needs.
Archetype storage
Entities with the same component set share contiguous, Structure-of-Arrays chunks (16 KB) sized for the cache.
SIMD-accelerated
Auto-detected SSE2/SSE4.2/AVX2 on x86 and NEON on ARM drive the hot iteration paths.
Compile-time queries
Expressive views with Not, Optional, Any, and OneOf modifiers, validated at compile time.
Relationship graphs
Hierarchies and many-to-many links live outside component storage to avoid archetype fragmentation.
Runtime reflection
Field enumeration, attributes, and JSON schema for editor-grade entity inspection.
Configurable chunk pool
A custom allocator with tunable chunk size, pre-warming, and optional huge-page support.
Batch operations
Bulk create/destroy and bulk add/remove amortize structural changes.
DLL-safe & hot-reload
Stable, process-shared type identity keeps component IDs consistent across module reloads.
Single-threaded core
The library spawns no threads; an injectable IWorkScheduler seam and a deferred CommandBuffer add parallelism only when you opt in.
Create, add, iterate.
A registry, a view, a loop: the whole API surface you need on day one.
Create a registry, add components, iterate a view
Astra::Registry registry;
auto entity = registry.CreateEntity<Position, Velocity>();
auto view = registry.CreateView<Position, Velocity>();
view.ForEach([](Astra::Entity e, Position& pos, Velocity& vel) {
pos.x += vel.dx; pos.y += vel.dy;
});Expressive queries with compile-time modifiers
auto enemies = registry.CreateView<Position, Enemy, Astra::Not<Dead>>();
auto renderables = registry.CreateView<Transform, Astra::Optional<Sprite>>();
auto weapons = registry.CreateView<Item, Astra::OneOf<Sword, Bow, Staff>>();Part of Starworks.
Build on Astra.
Header-only and MIT-licensed: drop it into any C++20 project.
- C++20
- v3.1.0
- MIT