patch to qsort

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

patch to qsort

djamel anonymous
Hello, this time i am resending my patch that divides by two the memory
usage of merge sort
used inside qsort(). this patch also reduces the recusrion depth by 1 level
in many cases.
i haven't compiled the file as is because i haven't downloaded the full
glibc source, but i
am 99% sure that it will compile.the test on a random 500k  integer elements
vector gave
0.40 seconds with the original and 0.37 second with the patched version.
with the vector
originally in reverse order this gave 0.25 with the original version and
0.20 with the
patched version.
best regards.

_________________________________________________________________
Testez Windows Llive Mail Beta !
http://www.msn.fr/newhotmail/Default.asp?Ath=f

new_msort.c (4K) Download Attachment
msort.c.diff (1K) Download Attachment