4 ms·
The optimization is usually called shapes outside of JS. The idea is that shapes (we represent objects like C like structs and not hash maps) are used for rela
by inglor 4y ago
The optimization is usually called shapes outside of JS.
The idea is that shapes (we represent objects like C like structs and not hash maps) are used for relatively non-dynamic objects and then we keep the shape metadata on functions themselves (inline caches) which means property access becomes just a byte offset.
See https://v8.dev/blog/fast-properties https://v8.dev/blog/fast-properties