Re: Results of the memswap() smackdown from the thread "Sorting" assignment




"Richard Heathfield" <rjh@xxxxxxxxxxxxxxx> wrote in message
Malcolm McLean said:

Yes, he did - but minimising memory accesses was not a design goal, so why
bother? What concrete benefit does it give? It certainly doesn't make the
code any faster. In fact, minimising memory accesses appears to carry a
significant performance penalty.

If you look at the timings other people posted you'll see that for tiny objects - under 4 bytes, my function performed best, though only by a small margin.

However that wasn't the case for my own timings. I suspect that what is happening is that my compiler - a freebie Microsoft one - is optimising the memcpy() calls more aggressively.
However I timed the entire combsort function, using short strings as the object to be sorted. In no cases did the swap seem to account for more than about 2% speedup of the entire sort.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

.