A fast, portable Entity Component System for Luau. https://ukendio.github.io/jecs/
Find a file
kuro e2c56f5420
Implement world:targets() as a valid method (#311)
* Implement world:targets

* Proper indexing in ECS_PAIR_SECOND

* Unit tests

* pull idr.records index out of iterator

* move tests below world:target

* style

* better test names

* change nth to use idr.records and pull out variables from iter

* local NOOP fn

* pull NOOP out of fn

* redeclare component_index as ct_idx

* black magic (inlined most of the function calls in iterator - yes it still passes tests)

* remove redundant fn call (shoutout to nnullcolumn for spotting this)

* add test for rapid add/remove calls

* run secondary mixing step for all entities and not just the alive ones

* redundant check

* be a bit more explicit for checking if an entity is alive
2026-04-21 13:15:13 +02:00
.github Allow contents to be written 2026-02-22 17:04:51 +01:00
examples Revoke token from example 2026-02-20 12:02:21 +01:00
how_to Update temperance 2026-03-01 19:45:38 +01:00
modules Throw error at structural changes within on_remove hooks 2026-03-10 03:11:43 +01:00
scripts Add some documentation to the exported functions 2026-01-03 17:27:36 +01:00
src Implement world:targets() as a valid method (#311) 2026-04-21 13:15:13 +02:00
test Implement world:targets() as a valid method (#311) 2026-04-21 13:15:13 +02:00
.gitignore Automatically build a rbxm of documentation for Studio users (#287) 2026-01-02 06:41:05 +01:00
.luaurc Fix alias paths 2025-11-30 08:19:28 +01:00
CHANGELOG.md Improve relationship performance 2025-08-07 18:53:50 +02:00
default.project.json Cleanup repository 2025-11-30 08:13:31 +01:00
LICENSE Optimize column access 2025-06-25 17:16:04 +02:00
package.json Explicit error message for double disconnect 2026-03-10 03:14:31 +01:00
README.md Automatically build a rbxm of documentation for Studio users (#287) 2026-01-02 06:41:05 +01:00
rokit.toml Automatically build a rbxm of documentation for Studio users (#287) 2026-01-02 06:41:05 +01:00
studio_docs.project.json Add some documentation to the exported functions 2026-01-03 17:27:36 +01:00
test.rbxl Fix desired id being overriden 2026-01-02 06:32:59 +01:00
tsconfig.json Optimize column access 2025-06-25 17:16:04 +02:00
wally.toml Explicit error message for double disconnect 2026-03-10 03:14:31 +01:00

Just a stupidly fast Entity Component System

  • Entity Relationships as first class citizens
  • Iterate 800,000 entities at 60 frames per second
  • Type-safe Luau API
  • Zero-dependency package
  • Optimized for column-major operations
  • Cache friendly archetype/SoA storage
  • Rigorously unit tested for stability

Get Started

It is recommended that you clone the repository and navigate the documentation in your favourite editor.

This repository includes a few subfolders that can help you get started with jecs:

  • how_to: This is a step-by-step introduction to how this ECS works and the reasoning behind its design.

  • modules: These are regularly used modules and should be mostly working, but some might not be. You can look in this folder to see some code that you might use to help you hit the ground running quickly.

  • examples: These are larger programs that showcase real use cases and can help you understand how everything fits together.

If you wish to view the documentation inside Roblox Studio, you can find an importable model file here.

Benchmarks

21,000 entities 125 archetypes 4 random components queried. Queries Can be found under /test/benches/visual/query.luau

Inserting 8 components to an entity and updating them over 50 times. Insertions Can be found under /test/benches/visual/insertions.luau