2 ms·
It’s the other way around. The use of opaque references instead of generics means that the compiler does not have type information to make optimizations. The cl
by zarzavat 5y ago
It’s the other way around. The use of opaque references instead of generics means that the compiler does not have type information to make optimizations. The classic example is qsort in C vs std::sort in C++ - the generic version of the algorithm in C++ is faster because the compiler has the type information required to optimize it properly.
- amelius 5y agoThere are compiler optimizations that infer/invent types at compile time.