This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: An improved merge-sort algorithm
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Wayne Davison <wayned at samba dot org>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Wed, 12 Dec 2007 13:34:37 +0100
- Subject: Re: An improved merge-sort algorithm
- References: <20071210011336.GA2119@blorf.net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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