develooper Front page | perl.perl5.porters | Postings from September 2009

Re: dual pivot quicksort

Thread Previous | Thread Next
September 28, 2009 04:59
Re: dual pivot quicksort
Message ID:
On Fri, Sep 25, 2009 at 03:58:27PM +0100, Nicholas Clark quoted John P. Linderman:
> With modern architectures, locality and pipelining
> can matter a bunch on real performance.  Somebody 
> in 2) observed that comparison is read-only, so it
> doesn't invalidate caches.  But it can break pipelining.
> And, if you are comparing *and* swapping native integers,
> you get huge locality wins, because everything you need
> is in the partition you are sorting.  If you are sorting
> pointers to things, not things, you don't get that huge
> locality win.

In Perl, comparison isn't always read-only. Even in the absense of ties
and overloads, there's always the string <-> number conversion that may
cause writes.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About