News for hackers. Stuff that matters.
Re:What part of Rust compilation is the bottleneck? by zozbot234 on Saturday March 16, 2024 @01:36PM (#39727833)
Monomorphization can be manually addressed in Rust by writing generic function impls as delegating to a single function where the generic pameters are partily or fully omitted - a kind of "polymorphization". This is a pretty common pattern, e.g. in the Rust std library. In more recent versions of Rust this can be expanded via the use of const generics, e.g. to express the size and alignment of a generic type parameter, where the implementation only depends on these. So this kind of "polymorphization" can be applied more broadly.

There are no comments on this comment yet.