News for hackers. Stuff that matters.
Re:Modern programming languages require generics by gpderetta on Wednesday May 25, 2022 @09:35AM (#31504322)
In principle yes. With enough constant propagation, inlining and/or intraprocedural optimizations, the compiler can indeed inline the comparator in qsort (and in practice GCC has been capable of it for a few years).

The problem is that it more work for the compiler. For example GCC has an early inliner pass that will exploit all easy "inlining" (like those provided by templates) to simplify the code and to expose more opportunities for later passes. On the other hand, indirect function inlining is only done at later stages. The effect is that indirect function call inlining is much less reliable and sometimes not as effective.

There are no comments on this comment yet.