An improved merge-sort algorithm
Jakub Jelinek
jakub@redhat.com
Wed Dec 12 12:29:00 GMT 2007
On Sun, Dec 09, 2007 at 05:13:36PM -0800, Wayne Davison wrote:
> Since the algorithm is a little more complex than the old one, I decided
> to use a macro as a function template. I also created a separate static
> function for each of the separate copy-size cases instead of using a
> switch inside a single function. A small number of inline copy-one-item
> functions makes the template easy for all the types.
I'm not convinced that's a good idea (separate routines for each size).
Have you checked the resulting code size of msort.os compared to unpatched
msort.os? It is already big as is, and the bigger it is the worse will
be I$ behavior of it. Many apps use various sized qsorts close to each other...
Jakub
More information about the Libc-alpha
mailing list