Skip to content

Commit f1b0c82

Browse files
authored
Update performance information in user guide text (#437)
1 parent bf63133 commit f1b0c82

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/content/architecture/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ allowing queries to quickly determine which archetypes are relevant.
4545

4646
Once matching archetypes are identified, queries can linearly iterate over their entities, a process that is both highly efficient and cache-friendly, thanks to the tight memory layout of archetype tables.
4747

48-
Component access through queries is extremely fast, often achieving near-constant time performance (~1ns per component) due to predictable memory access patterns and minimal indirection.
48+
Component access through queries is extremely fast (below 1ns per component) due to predictable memory access patterns and minimal indirection.
4949

5050
## World entity access
5151

5252
To retrieve components for a specific entity outside of query execution,
5353
the World maintains a list indexed by entity ID (as shown leftmost in the diagram above).
5454
Each entry in this list points to the entity's archetype and the position within the archetype's table.
5555

56-
This setup enables fast random access to component data, though slightly slower than query-based iteration (≈2ns vs. 1ns), due to the additional indirection.
56+
This setup enables fast random access to component data, though slightly slower than query-based iteration (≈2ns vs. <1ns), due to the additional indirection.
5757

5858
Note that the entity list also contains entities that are currently not alive,
5959
because they were removed from the {{< api ecs World >}}.
@@ -76,7 +76,7 @@ and that different "incarnations" of same entity ID can be distinguished.
7676
Archetypes are primarily designed to maximize iteration speed by grouping entities with identical component sets into tightly packed memory layouts.
7777
This structure enables blazing-fast traversal and component access during queries.
7878

79-
However, this optimization comes with a trade-off: Adding or removing components from an entity requires relocating it to a different archetype, essentially moving all of its component data. This operation typically costs ~10–20ns per involved component.
79+
However, this optimization comes with a trade-off: Adding or removing components from an entity requires relocating it to a different archetype, essentially moving all of its component data. This operation typically costs &approx;20ns per involved component.
8080

8181
To reduce the number of archetype changes, it is recommended to add/remove/exchange multiple components at the same time rather than one after the other. Further, operations can be [batched](../batch) to manipulate many entities in a single command. See chapter [Performance tips](../performance) for more details.
8282

0 commit comments

Comments
 (0)