Deep dive¶
The benchmarks section owns the numbers. This section owns the reasoning: why japes is built the way it is, what the optimisation journey taught us, and how to think about the system when you start hitting edges the tutorials don't cover.
Everything here is cross-referenced to the actual source files under
ecs-core/src/main/java/zzuegg/ecs/. Every claim about a data layout,
a fast-path short-circuit, or a fallback condition is verifiable
against the current code. If you spot a mismatch, the code wins — the
docs are describing it, not specifying it.
What to read first¶
-
Archetype + chunk storage, the
EntityLocationtable, why moves between archetypes are swap-removes on parallelObject[]columns. Start here if you have never read an archetype ECS internals doc before. -
How a
ChunkProcessoris emitted as a hidden class viajava.lang.classfile, why every argument hoists to a local, and whyinvokevirtualis the dispatch primitive. Links to the tier fallback catalog. -
Per-component
ChangeTracker, dirty bitmap + dirty list, strict>comparisons againstlastSeenTick, why tick-0 is the untracked sentinel. The core of why@Filter(Changed)scales with the dirty count, not the entity count. -
Non-fragmenting side-table storage,
Long2ObjectOpenMapprimitive keys, flatTargetSlice/SourceSliceinner maps, archetype marker components, cleanup policies,PairChangeTracker. Why relations do not fragment archetypes. -
Why
@Write Mut<Position>+record Positionis fundamentally more expensive thanpos.x += vel.dxon a mutable POJO, what you buy for the cost, and what Valhalla could fix. -
JEP 401 value records: ~2–4× faster reads at 100k, ~10% on writes, the explicit flat-array opt-in, and why it stays off by default.
-
How the 500×2000 predator/prey cell went from 167 µs at PR-landing to 27.6 µs today. Round by round: what each fix saved, what the profile showed, and which ideas did not help.
What this section is not¶
It is not a tutorial, and it is not a reference for the user-facing API. For the hands-on walkthrough, read the tutorials. For a dry list of annotations and parameter types, read the cheat sheet. For throughput and latency numbers, read the benchmarks.
The pages below exist because performance work on japes has produced a coherent body of why-level knowledge — design trade-offs made, rabbit holes explored, optimisations that worked, and a few that didn't — that is neither tutorial material nor benchmark material. This is the place for it.
Reading order¶
The pages are written to stand alone. You can jump straight to relations or valhalla-investigation if that's what you came for. But if you are reading top-to-bottom for the first time, the natural order is:
- Architecture — what the storage layer looks like
- Tier-1 generation — how systems dispatch onto it
- Change tracking — what the tick-based filter machinery does
- Relations — the non-fragmenting pair feature
- Write-path tax — the API trade-off all the write-heavy benchmarks are measuring
- Valhalla investigation — what JEP 401 gives us today
- Optimisation journey — the war story
Related¶
- Benchmarks — Methodology — how the numbers were measured
- Reference — Tier-1 vs tier-2 dispatch — exact catalogue of what falls back to reflective tier-2
- Getting started — installation and first-world walkthrough