CPU Performance: Objects vs Arrays
normal JS objects = lots of indirection
when you write:
const pos = { x: 10, y: 20 };
you don’t get one neat chunk of memory with [10,20] side-by-side.
instead:
pos is a pointer to an object record.
inside that record are pointers to each property...
tigerabrodi.blog1 min read