From ihaka@stat.auckland.ac.nz  Wed Sep  3 23:26:46 1997
From: ihaka@stat.auckland.ac.nz (Ross Ihaka)
Date: Thu, 4 Sep 1997 10:26:46 +1200 (NZST)
Subject: R-alpha: speed of  sort(.) and order(.)
In-Reply-To: <199709031613.SAA01385@sophie.ethz.ch>
References: <199709031613.SAA01385@sophie.ethz.ch>
Message-ID: <199709032226.KAA22616@stat1.stat.auckland.ac.nz>

Martin Maechler writes:
[ stuff on sorting  which I leave out ]

 > which makes 'sort' almost a factor of 2  FASTER for an unsorted 'x'.
 > 
 > Any comments from the coders  (R & R) ?

I wasn't there, I hardly knew the woman and anyway it wasn't my dog :-).

Well, I didn't look closely at the code, but as I recall both "sort"
and "order" use a shellsort recomended by Sedgewick (he says only
true sorting gurus like him should attempt quicksort and that mortals
like me should stick with shellsort).

It does look odd.  When I get a moment I will dig deeper.
	Ross
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: speed of sort(.) and order(.)
Ross Ihaka