stdio performance in tango, stdlib, and perl

kris foo at bar.com
Wed Mar 21 16:11:24 PDT 2007


Andrei Alexandrescu (See Website For Email) wrote:
> kris wrote:
> 
>> Andrei Alexandrescu (See Website For Email) wrote:
>>
>>> 13.9s        Tango
>>> 6.6s        Perl
>>> 5.0s        std.stdio
>>
>>
>>
>> There's a couple of things to look at here:
>>
>> 1) if there's an idiom in tango.io, it would be rewriting the example 
>> like this:  Cout.conduit.copy (Cin.conduit)
> 
> The test code assumed taking a look at each line before printing it, so 
> speed of line reading and writing was deemed as important, not speed of 
> raw I/O, which we all know how to get.

Yep, just trying to isolate things

>> 3) the test would appear to be stressing the parsing of lines just as 
>> much (if not more) than the io system itself. All part-and-parcel to a 
>> degree, but it may be worth investigating
> 
> 
> I don't understand this.

Just suggesting that the scanning for [\r]\n patterns is likely a good 
chunk of the CPU time

>> b) foregoing the output .newline, purely as an experiment
> 
> 
> 4.7s    tcat

Thanks. If tango.io were to retain CR on readln, then it would come out 
ahead of everything else in this particular test

Can you distill the benefits of retaining CR on a readline, please?



More information about the Digitalmars-d mailing list