[phobos] std.algorithm.sort slow as molasses

Walter Bright walter at digitalmars.com
Fri Jul 2 13:36:14 PDT 2010



Andrei Alexandrescu wrote:
> Working around that would mess much of the elegance of std.sort, sigh. 
> The nice thing is that sort reuses partition instead of writing a 
> dedicated version of it (as I had in my implementation for a while). I 
> was quite glad I'd pulled that off.
>

Most heavily optimized implementations of things tend to have lost their 
elegance. qsort is no stranger to that. Just look at all the nasty 
things people do trying to make memcpy() run faster!


More information about the phobos mailing list