Why is stdin.byLine.writeln so slow?

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jun 13 14:17:26 PDT 2014


On 06/13/2014 02:08 PM, monarch_dodra wrote:

 > Given this input:
 > line 1
 > line    2
 > Yo!
 >
 > Then "stdin.byLine.writeln" will produce this string:
 > ["line 1", "line\t2", "Yo!"]

Do you mean writeln() first generates an array and then prints that 
array? I've always imagined that it used the range interface and did 
similar to what copy() does.

Is there a good reason why the imagined-by-me-range-overload of 
writeln() behaves that way?

Ali



More information about the Digitalmars-d-learn mailing list