Re: qsort (was Re: Solaris)

From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Mike Castle <dalgoda(at)ix(dot)netcom(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: qsort (was Re: Solaris)
Date: 2003-05-01 22:52:11
Message-ID: 3EB1A51B.3070806@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Martijn van Oosterhout wrote:

> Anyway, on a Debian Woody machine here I get:
>
>10^6 items, mod = 100
>
>Value (i = index) BSD GLIBC (seconds)
>random() * mod 1.58 2.29
>i % mod 0.52 1.69
>i / (ITEMS / mod) 0.38 1.09
>i ^ 0x5555555 1.18 1.67
>
>It would seem to support the theory that the BSD qsort is faster than the
>Glibc one. The results seem quite repeatable (repeats give +/- 5%).
>
Martin's test on two Linux machines here gives :

10^6 items, mod = 100

1) Mandrake 9 (x86 - Linux 2.4.19, glibc 2.2.5, gcc 3.2)

Value (i = index) BSD GLIBC (seconds)
random() * mod 2.20 2.70
i % mod 0.80 2.10
i / (ITEMS / mod) 0.53 1.28
i ^ 0x5555555 1.64 1.95

2) Yellowdog 2.3 (ppc - Linux 2.4.19, glibc 2.2.5. gcc 2.95.4)

Value (i = index) BSD GLIBC (seconds)
random() * mod 1.74 3.12
i % mod 0.69 2.65
i / (ITEMS / mod) 0.55 1.66
i ^ 0x5555555 1.42 2.45

Interestingly, the the ppc machine gets more improvement from the BSD
qsort than the x86 one does.

regards

Mark

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-05-01 23:02:14 Re: Do I need a special version of Postgresql to run on
Previous Message Hadley Willan 2003-05-01 22:48:24 Do I need a special version of Postgresql to run on RH Linux Enterpise Standard?