Re: [HACKERS] qsort again

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: [HACKERS] qsort again
Дата
Msg-id 20060216124918.GE26127@svana.org
обсуждение исходный текст
Ответ на Re: [HACKERS] qsort again  (Florian Weimer <fw@deneb.enyo.de>)
Ответы Re: [HACKERS] qsort again  (Sven Geisler <sgeisler@aeccom.com>)
Список pgsql-performance
On Thu, Feb 16, 2006 at 01:10:48PM +0100, Florian Weimer wrote:
> * Neil Conway:
>
> > On Wed, 2006-02-15 at 18:28 -0500, Tom Lane wrote:
> >> It seems clear that our qsort.c is doing a pretty awful job of picking
> >> qsort pivots, while glibc is mostly managing not to make that mistake.
> >> I haven't looked at the glibc code yet to see what they are doing
> >> differently.
> >
> > glibc qsort is actually merge sort, so I'm not surprised it avoids this
> > problem.
>
> qsort also performs twice as many key comparisons as the theoretical
> minimum.  If key comparison is not very cheap, other schemes (like
> heapsort, for example) are more attractive.

Last time around there were a number of different algorithms tested.
Did anyone run those tests while getting it to count the number of
actual comparisons (which could easily swamp the time taken to do the
actual sort in some cases)?

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

В списке pgsql-performance по дате отправления:

Предыдущее
От: Florian Weimer
Дата:
Сообщение: Re: [HACKERS] qsort again
Следующее
От: Sven Geisler
Дата:
Сообщение: Re: [HACKERS] qsort again