std.partition is fucked

Sean Kelly sean at invisibleduck.org
Wed May 13 12:41:18 PDT 2009


== Quote from Lutger (lutger.blijdestijn at gmail.com)'s article
>
> Some time ago I reinvented these wheels for study purpose. A custom stack was a little faster but not
that much. std.swap can't be inlined because it uses ref params, that cost also a bit since it's called
> many times. Switching to another sort if a certain recursion depth is reached helped, but mostly in
degenerate cases.
> I still have the thing somewhere, it is about twice as fast as builtin sort. It's not a lot of work but I could
dig it up and provide some timings if you want.

The sort I wrote for Tango uses the same basic heuristics, thanks to
a ticket that either you or Stewart Gordon submitted long ago.  I've
been meaning to compare it against the sort routine in std.algorithm
to see whether the Phobos routine could benefit from any of the same
tweaks.



More information about the Digitalmars-d mailing list