At how many entities does an ECS start paying off?
There is no crossover: struct-of-arrays beat plain objects at every count. But the saving only reaches a whole millisecond per frame at 184,000 entities.
Blog / Topic · page 2 of 2
Benchmarks with the method shown — what is actually fast, what only looks fast, and by how much.
There is no crossover: struct-of-arrays beat plain objects at every count. But the saving only reaches a whole millisecond per frame at 184,000 entities.
Multiplying by deltaTime does not make a game frame-rate independent. A fixed-timestep accumulator closes the gap, then brings failure modes of its own.
Serialising a big save with JSON.stringify cost a whole 60 fps frame. The bigger problem was old saves loading silently wrong after a schema change.
An all-pairs loop stops fitting in a single frame at 5,700 objects in Node. A uniform grid goes far past that; a quadtree breaks much earlier.
We timed every way to load a 5-million-row CSV into Postgres 16. COPY won by 120x over an INSERT loop; several popular tweaks barely mattered.
We ran the same Node workload natively and in Docker on a Mac. CPU, memory and the bridge network were free; the slow parts belonged to the Linux VM.
On Postgres 16 at ten million rows, an exact COUNT(*) read every visible tuple and no index helped. reltuples drifted; n_live_tup stayed within 0.008%.
We measured HTTP against HTTPS on Node 23 over loopback to isolate CPU. TLS took 23% of small-response throughput; with ECDSA, resumption saved nothing.
On Postgres 16, each extra btree index added a fixed WAL and time cost to every insert. On two of the four write paths, though, extra indexes cost nothing.
We swept Postgres 16 from 5 to 400 connections on fixed cores. Throughput peaks at a small multiple of the core count; past it, latency climbs fast.
We benchmarked a SKIP LOCKED Postgres queue at 1 to 100 workers. It peaked near 16,000 claims a second, and autovacuum gave out long before row locks did.
Ignore the cost numbers. Compare estimated rows with actual rows on every plan node and find the first big disagreement. That node is your bug.