Re: qsort again

Поиск
Список
Период
Сортировка
От Florian Weimer
Тема Re: qsort again
Дата
Msg-id 873bijsdvb.fsf@mid.deneb.enyo.de
обсуждение исходный текст
Ответ на Re: qsort again (was Re: [PERFORM] Strange Create Index  (Neil Conway <neilc@samurai.com>)
Ответы Re: qsort again  (Martijn van Oosterhout <kleptog@svana.org>)
Re: [PERFORM] qsort again  (Ron <rjpeace@earthlink.net>)
Список pgsql-hackers
* 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.

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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Generating config stuff from single source
Следующее
От: Dhanaraj
Дата:
Сообщение: Doubt in parser