www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6064] New: std.array.join is unnecessarily slow for strings

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6064

           Summary: std.array.join is unnecessarily slow for strings
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: performance
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: jmdavisProg gmx.com
        ReportedBy: thecybershadow gmail.com



13:40:32 PDT ---
std.array.join(x) does not special-case for strings. This causes joined strings
to be copied character-by-character.

std.array.join(x,x) does attempt to special-case for strings, but only when
only the first argument is a string - and even then, this doesn't work:

C:\...\std\array.d(778): Error: template std.algorithm.copy(Range1,Range2) if
(isInputRange!(Range1) && isOutputRange!(Range2,ElementType!(Range1))) does not
match any function template declaration
C:\...\std\array.d(778): Error: template std.algorithm.copy(Range1,Range2) if
(isInputRange!(Range1) && isOutputRange!(Range2,ElementType!(Range1))) cannot
deduce template function from argument types !()(Result,string)
test.d(9): Error: template instance
std.array.join!(string[],Map!(result,string)) error instantiating

Program:

import std.array;
import std.algorithm;

void main()
{
    string[] arr;
    string sep;

    join(arr, map!"a"(sep));
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 27 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6064




PDT ---
https://github.com/D-Programming-Language/phobos/pull/146

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 15 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6064


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



PDT ---
Fixed:
https://github.com/D-Programming-Language/phobos/commit/55fc7a2154c208cca05f16614ae9ca75c7b62911

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 16 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6064


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc



*** Issue 6271 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 16 2011