On Sunday, 11 December 2016 at 02:46:58 UTC, Nicholas Wilson
wrote:
join performs allocations which is probably the reason for its
slowness. There is joiner (in std.algorithm.iterations) that
lazily performs the join, (though in the case of this
"benchmark" will be cheating because you don't do anything with
the result, print it to get a more fair comparison) avoiding
allocation.
see also appender (in std.array) for fast concatenation.
Thanks, Stefan and Nicholas. I think joiner did the trick (for
50M iterations, ~2s for D, ~17s for Python).