Benchmark methodology (all runs reproducible with bench.js):
Node v22, Intel Xeon Platinum 8370C
15 runs, reporting median
Deterministic PRNG → identical ops across runs
Mixed workload: 40% reads, 20% updates, 20% simple queries, 20% compound
--expose-gc for accurate memory measurement
Key design decisions that drive performance:
Memory: ~667 bytes/entity core, +81% with journaling (tinyop+)
Spatial: Grid + type indexes → filters type first, then grid (90% fewer distance calcs)
Cache: 128-entry LRU with per-type invalidation (enemy writes don't flush player queries)
Views (v3.4): O(1) after first eval, auto-update on changes
Persistence: BYO – dump() to JSON, IndexedDB, or your backend
Reproduce on your hardware: node bench.js --expose-gc
Displayusername•1h ago
Key design decisions that drive performance: Memory: ~667 bytes/entity core, +81% with journaling (tinyop+) Spatial: Grid + type indexes → filters type first, then grid (90% fewer distance calcs) Cache: 128-entry LRU with per-type invalidation (enemy writes don't flush player queries) Views (v3.4): O(1) after first eval, auto-update on changes Persistence: BYO – dump() to JSON, IndexedDB, or your backend
Reproduce on your hardware: node bench.js --expose-gc