PG qsort vs. Solaris - Mailing list pgsql-hackers

From Zdenek Kotala
Subject PG qsort vs. Solaris
Date
Msg-id 45225A85.5020008@sun.com
Whole thread Raw
Responses Re: PG qsort vs. Solaris  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Postgres has own implementation of qsort. It is used only for Solaris, 
because in some cases Solaris implementation was terrible slow.

Now, New qsort is present in the Solaris from version 9 update 6 and I 
performed some quick test and the speed is very similarly with pg 
implementation see bellow. The Solaris qsort only does not have test for 
preordered array.

Is it time to "remove" PG qsort and use libc version for solaris 9, 10...?

There some useful links:
solaris qsort implementation
http://cvs.opensolaris.org/source/xref/on/usr/src/common/util/qsort.c
discuss about qsort
http://momjian.postgresql.org/cgi-bin/pgtodo?qsort


    Regards Zdenek


PS: Test program is located on 
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=4489885

There is test result:

mode     1    2    3    4    5    6    7    8
pg     3.440  54.259  42.251  40.967  38.214  29.730  21.668  39.142
pg2     39.492  53.598  44.697  40.546  38.027  29.572  21.598  38.756
solaris 41.207  41.957  41.873  41.616  35.895  29.502  26.906  39.492


Pg2 test is without sort array prechecking.




pgsql-hackers by date:

Previous
From: "Zeugswetter Andreas DCP SD"
Date:
Subject: Re: Faster StrNCpy
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] Bad bug in fopen() wrapper code