Re: Which qsort is used

From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Which qsort is used
Date: 2005-12-12 17:09:16
Message-ID: dnkaq4$1lqg$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


"Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote
>
> Are you willing to say that we should always prefer pgport over glibc's
> qsort()?
>

At least for Linux and windows. My test is performed on a dataset ranges
from 10 to 15000000 elements. Each elements contains a 64 bytes garbage
character area and an integer key, which is uniformly distributed from 1 to
RANGE. RANGE takes values from 2 to 2^31. In all cases, our qsort absolutely
wins. Maybe skewed distribution should be tested?

Another interesting thing is that the qsort on RANGE=2 or other small number
in windows is terriblly slow - our version does not have this problem.

The test code could be found here (Note: it mixed with some other
experiements I am doing but might be a good start point to construct your
own tests):

http://www.cs.toronto.edu/~zhouqq/sort.c

Regards,
Qingqing

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Pflug 2005-12-12 17:11:44 Re: pg_relation_size locking
Previous Message Jan Wieck 2005-12-12 17:04:25 Re: Foreign key trigger timing bug?