Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Nomenclature

Quick reference for symbols, notation, and abbreviations the book uses. Concept definitions live in the glossary; this page covers the shorthand only.

Symbols

SymbolMeaning
§NSection number - e.g., §5 refers to section 5.
Leads to / becomes / transitions to. Appears in section titles (e.g., §29 “10K → 1M”) and prose.
[!NOTE] / [!TIP] / [!WARNING]Callout box - content the reader should pay particular attention to.

Text formatting

FormMeaning
monospaceCode: types, variable names, function names, file paths.
italicFirst definition of a term, or emphasis.
boldA term being highlighted as load-bearing in the current paragraph.
# anti-pattern: bad!A code comment that flags the snippet as something the chapter is arguing against. The label travels with the code if a reader copy-pastes.

Variables you will see across chapters

VariableMeaning
i, jA slot: the current column position of a row. i is the slot under discussion, j a second one. A slot is not stable - sort and swap_remove move rows between slots (§9, §21).
t or tickTick number - the simulator’s step counter.
idA stable entity identifier that travels with a row across reorders, unlike its slot (§10). A small unsigned integer, usually np.uint32.
genGeneration counter, paired with a slot index to detect stale references (§10).
pos_x, pos_yPosition columns of a creature (np.float32).
vel_x, vel_yVelocity columns of a creature (np.float32).
to_remove, to_insertBuffers of pending mutations applied at end-of-tick (§22).
n_activeLength of the live prefix of a fixed-capacity column (§21, §24).

Python types and their numpy counterparts

This book uses numpy’s typed dtypes for hot data. The mapping the reader will see most often:

Pythonnumpysizerange
int (CPython, ≤ 2³⁰)-28 bytesunbounded
-np.int81 byte-128 to 127
-np.uint81 byte0 to 255
-np.int324 bytes±2³¹
-np.uint324 bytes0 to 2³²
-np.int648 bytes±2⁶³
float (CPython)np.float648 bytes (CPython has 24-byte object overhead)~15 decimal digits
-np.float324 bytes~7 decimal digits
-np.bool_1 byte (in arrays)True / False

Abbreviations

AcronymExpanded
ECSEntity-Component-Systems
EBPExistence-Based Processing
DODData-Oriented Design
SoAStructure of Arrays - each field is its own column.
AoSArray of Structures - each row is its own object (tuple, dataclass, or class instance).
DAGDirected Acyclic Graph
RSSResident Set Size - the physical memory a process holds, as the OS reports it
IOPSI/O Operations Per Second
TDDTest-Driven Development
LRULeast Recently Used (cache eviction policy)
OOMOut Of Memory (the allocator fails, or the OS OOM-killer steps in)
IPCInter-Process Communication
SMTSimultaneous Multi-Threading (two hardware threads sharing one core)
ISAInstruction Set Architecture
ORMObject-Relational Mapper (the row-per-object database layer §36 critiques)

EBP is this book’s shorthand. The spelled-out term - existence-based processing - is Richard Fabian’s, from Data-Oriented Design; §17 introduces it from the simulator. An acronym index will not list “EBP” because the source literature spells the term out rather than abbreviating it.

Conventions for code blocks

FormConvention
Plain triple-backtick pythonA snippet to read; not necessarily complete.
Snippet with # anti-pattern: bad! first lineA snippet shown as the wrong way; the chapter is about the right way.
uv run code/measurement/<file>.pyA measurement exhibit the reader can run on their machine. The numbers in the chapter were measured the same way.