monomorphization
The compiler making a separate copy of generic code for each type it is used with.
Monomorphization compiles each generic item once per concrete set of type arguments, producing specialized machine code with no runtime dispatch.
Loading interactive…
Examples
Change<u8>andChange<String>come from one definition but are separate types: 2 bytes and 48 bytes on a 64-bit machine.
See also