monomorphic

Describes a place in the code that always sees objects of one single shape, which lets TurboFan optimise it best.

In more detail

A function called only with objects built the same way, such as { x, y }, stays monomorphic. Its property reads can then be compiled into direct memory accesses.

Related terms

Taught in

References