stdio performance in tango, stdlib, and perl

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Thu Mar 22 09:34:01 PDT 2007


kris wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> kris wrote:
> [snip]
>>> That aside, tango.io appears to be fast enough and simple enough. The 
>>> fastest in this case, even, assuming we do something useful about the 
>>> CR chop, .newline is adjusted, or "\n" is used instead ;)
>>
>>
>> Do it and let's test.
> 
> you can try it right now with a Cout(line)("\n");
> 
> The option to eschew the chop is checked in also. You'll perhaps see 
> from the Win32 tests that tango.io is pretty darned fast anyway?

On my Linux box:

import tango.io.Console;
void main()
{
   char[] line;
   while (Cin.nextLine(line)) {
     Cout(line)("\n");
   }
}

7.8s		tcat


Andrei



More information about the Digitalmars-d mailing list