|
From: | Paul Thomas |
Subject: | Re: benchmarks - sort |
Date: | Thu, 22 Jan 2004 14:26:20 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 |
David,In spite of promising to shut up about this, here is the result of modifying my sort DLD to deal with NaNs!
With your mod included and 10^5 randomly distributed elements, perverted by 1 NaN, octave's sort runs in 0.35s and mysort2 in 0.21s. If the operator does not deal with NaNs, this latter is 0.18s. Of course, a preliminary sort that put NaNs, -inf and +infs in their correct places would more or less recover the lower figure. Most of the performance improvement is obtained from the use of a pointer array, which is the only array being sorted. The algorithm that used a multimap, sorted double pairs and so ran up an extra overhead in movs.
In conclusion, I will use your sort algorithm but found mine to be an interesting exercise.
Best regards Paul
[Prev in Thread] | Current Thread | [Next in Thread] |