Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: "Malcolm McLean" <regniztar@xxxxxxxxxxxxxx>
- Date: Sat, 16 Feb 2008 21:01:15 -0000
"Richard Heathfield" <rjh@xxxxxxxxxxxxxxx> wrote in message
Malcolm McLean said: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.
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.
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
.
- Follow-Ups:
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: Ben Bacarisse
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: Richard Heathfield
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- References:
- Results of the memswap() smackdown from the thread "Sorting" assignment
- From: spinoza1111
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: Ben Bacarisse
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: spinoza1111
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: Ben Bacarisse
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: Randy Howard
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: spinoza1111
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: Randy Howard
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: spinoza1111
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: Ben Bacarisse
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: spinoza1111
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: Stephen Howe
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: spinoza1111
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: Randy Howard
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: spinoza1111
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: Randy Howard
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: Malcolm McLean
- Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- From: Richard Heathfield
- Results of the memswap() smackdown from the thread "Sorting" assignment
- Prev by Date: Re: "STL from the Ground Up"
- Next by Date: Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- Previous by thread: Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- Next by thread: Re: Results of the memswap() smackdown from the thread "Sorting" assignment
- Index(es):