#ecs #gravitron #entity #game #gravitron-ecs

gravitron_ecs

A simple and performant ECS for Gravitron

7 unstable releases (3 breaking)

new 0.4.1 May 1, 2025
0.4.0 Jan 21, 2025
0.3.0 Oct 29, 2024
0.2.0 Oct 2, 2024
0.1.2 Sep 13, 2024

#1187 in Game dev

Download history 66/week @ 2025-01-15 49/week @ 2025-01-22 4/week @ 2025-01-29 12/week @ 2025-02-05 28/week @ 2025-02-19 16/week @ 2025-03-05 3/week @ 2025-04-09 9/week @ 2025-04-23 151/week @ 2025-04-30

163 downloads per month
Used in 6 crates

MIT/Apache

77KB
2.5K SLoC

Gravitron ECS

Performant ECS for Gravitron

Features

  • Components with a derive macro
  • Systems as normal functions with queries to query the world, commands to modify entities and global resources
  • Ability for parallel execution with automatic detection for interference between systems and parallelizing optimization using RLF

Benchmarks

format: debug release

create entity

initial: 23ys 4ys average: 1.6ys 200ns

add component

initial: 11ys 2ys average: 1.2ys 140ns

get component

initial: 1.8ys 200ns average: 750ns 80ns

Dependencies

~2.1–2.9MB
~65K SLoC