https://issues.dlang.org/show_bug.cgi?id=15553
--- Comment #1 from Timothee Cour <timothee.co...@gmail.com> --- haven't profiled, but: could uniform be slow https://github.com/D-Programming-Language/phobos/commit/7291d2e47d4a7fb17565a7d7cd04ba8f893c1a27 not sure if those could help: #5514 Maybe this is most relevant: [std.algorithm: implement deterministic topN] https://issues.dlang.org/show_bug.cgi?id=12141 At the very least, it shouldn't be slower than sort --