From octave-maintainers-request at bevo dot che dot wisc dot edu Tue Jan 6 04:21:26 2004 Subject: Re: benchmarks - sort From: Schloegl Alois To: Paul Kienzle Cc: octave-maintainers at bevo dot che dot wisc dot edu Date: Tue, 6 Jan 2004 11:21:15 +0100 Zitat von Paul Kienzle : > > Paul Thomas pointed me to these benchmarks. Anybody want to do > something about them? > > http://www.sciviews.org/other/benchmark.htm > ... > > I.C Matlab 0.89 - Octave 7.77 > b = sort(a); > > Octave's sort is surprisingly slow. 3x worse than any other package > mentioned. Anyone know a fast stable sort algorithm? > One reason, for the bad performance of the sort algorithm might be the exception handling of NaNs. See also http://www.octave.org/octave-lists/archive/bug-octave.2001/msg00047.html Sorting on the binary level might be helpful, because the bit patterns of the IEEE754 numbers provide the correct sorting order. This is -inf < -1 < 0 < 1 < inf < NaN Just my few thougths. Alois