Summary: Arrays in Phobos shold be pre-allocated.
           Product: D
           Version: 2.022
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos

Looking at the sources to Phobos, I see several places, including, and the array-to-array conversion function of std.conv,
where the ~= operator is used, even though the length of the array returned by
these functions is known at the beginning of the function.  This severely hurts
the performance of these functions, given how slow ~= is.  Furthermore, even if
~= were efficient, reallocating an array instead of preallocating is still too
inefficient when it can be trivially optimized out.


Reply via email to