[P2][ECS] Evaluate archetype component membership and transition costs

Open
#144 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

area: ecs help wanted priority: P2 type: performance

Problem and goal

Archetype::has and column_index use linear scans; hot structural churn may benefit from a different representation.

Implementation scope

  • Benchmark membership and column lookup across 2, 8, 16, 32+ components per archetype.
  • Measure transition-edge cache effectiveness during repeated add/remove operations.
  • Prototype compact index/bitset only if measured costs justify memory and code complexity.
  • Check data layout and cold-start behavior.

Acceptance criteria

  • Before/after time and memory measurements documented.
  • No additional allocations in fast query iteration unless explicitly justified.
  • Existing archetype and structural tests pass.

Relevant code

  • crates/crabby_ecs/src/storage.rs
  • crates/crabby_ecs/src/world.rs

Dependencies and notes

Research first; no replacement without measured win.

Compatibility: preserve existing public Rust and C/C++ APIs unless an independently approved design explicitly requires a breaking change. Collect correctness results and before/after measurements for performance-oriented changes.

Source audit and first contribution (2026-11-09)

Reviewed against source baseline df5c1d4 and merged implementation PRs through #167. The full issue acceptance criteria are still open; this audit does not mark the task complete. Existing priority is unchanged.

Starting point: Archetype transition caching already exists in storage.rs/world.rs; membership and column lookup still use linear scans.

First slice: Measure membership, column lookup and transition-cache hit rates across component widths before proposing indexes/bitsets.

Dependencies and coordination: Use #132. Distinguish membership lookup from sparse component storage research #166.

Focused Rust-only PRs are welcome; a contributor need not complete this entire issue in one PR or also implement C/C++ bindings and guide chapters. Maintainers coordinate scoped documentation/native follow-ups. Preserve existing compatibility and supply tests/evidence relevant to the slice.

Dominant language
Rust
Stars
4
Forks
0
Avg merge
45m
Merged PRs (30d)
199

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ponkoengine/ponko

All issues in ponkoengine/ponko

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.