Christopher Seiwald wrote...
>Archie's mod to qsort:
>
>| >- if (swap_cnt == 0) { /* Switch to insertion sort */
>| >+ if (n <= 32 && swap_cnt == 0) { /* Switch to insertion sort */
>
>As Akira Wada points out, this eliminates the benefit of the
Christopher Seiwald wrote...
>Archie's mod to qsort:
>
>| >- if (swap_cnt == 0) { /* Switch to insertion sort */
>| >+ if (n <= 32 && swap_cnt == 0) { /* Switch to insertion sort */
>
>As Akira Wada points out, this eliminates the benefit of the
quot;a reversed dataset would be partitioned
into two subpartitions sorted in order at the 1'st pass
of the partitionings".
-Akira Wada
To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-hackers" in the body of the message
quot;a reversed dataset would be partitioned
into two subpartitions sorted in order at the 1'st pass
of the partitionings".
-Akira Wada
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message
--
for qsort.c,v 1.9 1998/06/30 11:05:11
@@ -102,2 +102,5 @@
swap_cnt = 0;
+ pl = (char *)a; pn = (char *)a + (n - 1) * es;
+ while (pl < pn && cmp(pl,
--
for qsort.c,v 1.9 1998/06/30 11:05:11
@@ -102,2 +102,5 @@
swap_cnt = 0;
+ pl = (char *)a; pn = (char *)a + (n - 1) * es;
+ while (pl < pn && cmp(pl,
= (char *)a + (n - 1) * es;
+ while (pl < pn && cmp(pl, pl + es) pl += es;
+ if (pl >= pn) return;
if (n < 7) {
--
-Akira Wada
To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-hackers" in the body of the message
= (char *)a + (n - 1) * es;
+ while (pl < pn && cmp(pl, pl + es) pl += es;
+ if (pl >= pn) return;
if (n < 7) {
--
-Akira Wada
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message
> It's a pretty straightforward change to bypass the insertion sort for
> large subsets of the data. If no one has a strong love for qsort, I'll
> educate myself on how to make and contribute this change.
How about the code following sig. ?
And th
r.)
>
> It's a pretty straightforward change to bypass the insertion sort for
> large subsets of the data. If no one has a strong love for qsort, I'll
> educate myself on how to make and contribute this change.
How about the code following sig. ?
And the other codes and
10 matches
Mail list logo