Test Selection Rationale

March 15, 2026 · View on GitHub

Why these tests, and what each one reveals. For full test specifications, see specifications.md.


Test Overview

The suite contains 19 tests across 5 groups, each targeting a distinct performance dimension.

Entity (3 tests)

TestMeasures
create_emptyEntity allocation cost alone
create_with_componentsEntity allocation with component attachment
destroyEntity removal from a populated world

Component (4 tests)

TestMeasures
getField read speed on table components
setField write speed on table components
addComponent insertion cost (archetype transition)
removeComponent removal cost (archetype transition)

Tag (3 tests)

TestMeasures
hasTag presence check cost
addTag insertion cost (structural change)
removeTag removal cost (structural change)

System (6 tests)

TestMeasures
throughputPer-entity iteration cost (1 system, 100% match)
overlapScheduling efficiency with overlapping queries (3 systems)
fragmentedIteration across 20 archetypes (2 systems)
chainedData-dependency pipeline (4 systems, A → B → C → D → E)
multi_20Per-system dispatch overhead (20 systems, 100% match)
empty_systemsShort-circuit cost with zero matching entities (20 systems)

Structural Scaling (3 tests)

TestMeasures
createEntity creation cost with 20 registered systems
add_componentComponent addition cost with 20 registered systems
destroyEntity destruction cost with 20 registered systems

Three tests suffice because create, add, and destroy all trigger the same system-matching overhead. Additional operations (remove, create_empty, tags) would repeat the same scaling pattern without new information.

The group registers 20 background no-op systems (matching the multi_20 and empty_systems count) that query Position + Velocity — the same components the tracked entities carry. Comparing these results against the zero-system baselines in Parts 1-3 reveals how much each framework's structural cost grows with system count.