www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18463] New: std.algorithm.joiner is slow

https://issues.dlang.org/show_bug.cgi?id=18463

          Issue ID: 18463
           Summary: std.algorithm.joiner is slow
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: greensunny12 gmail.com

tl;dr: joiner is twice as slow than a foreach loop


A first start:

https://gist.github.com/wilzbach/ffd5d20639766a831fd4b1962572897a

While it's quite an improvement for LDC, it reduces the performance for DMD.
Moreover, the `alias this` trick used to introduce as little changes as
possible introduces a overhead too.

--
Feb 18 2018