Open Source · C++20 · Header-only ECS

Astra

High-performance archetype ECS for modern C++.

C++20·v3.1.0·MIT

1B+ iterations/sec

Header-only C++20

SIMD: SSE · AVX2 · NEON

MIT licensed

Performance

A billion iterations a second.

Operations per second over 10K to 1M entities, by how many components each query touches.

1.04 B/sSingle component
465 M/sTwo components
368 M/sThree components
236 M/sFive components
Single component1.04 B/s
Two components465 M/s
Three components368 M/s
Five components236 M/s

Intel Core i7 — 20 cores @ 3.6 GHz · Cache-optimized — L1/L2/L3 friendly · Modern C++20 — Zero-overhead abstractions

Capabilities

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.

In code

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>>();
Astra

Build on Astra.

Header-only and MIT-licensed: drop it into any C++20 project.

  • C++20
  • v3.1.0
  • MIT