stdio performance in tango, stdlib, and perl

Davidl Davidl at 126.com
Thu Mar 22 22:32:09 PDT 2007


great job!
i didn't know I/O performance could variate in such a great range.
and thanks for the great job from tango team.
heh, now d's I/O is as fast as c ?
or tango is even faster than C's I/O?

> Andrei Alexandrescu (See Website For Email) wrote:
>
>> I've ran a couple of simple tests comparing Perl, D's stdlib (the coming
>> release), and Tango.
>
> I have uploaded a snapshot with prebuilt libraries to
>
> http://larsivi.net/files/tango-SNAPSHOT-20070322.tar.gz
>
> The prebuilt libraries are in the lib/ folder. Install libphobos.a as  
> usual,
> and add libtango.a to your compile command. The test program (io.d below)
> should be compiled using the line
>
> dmd -O -release -inline io.d libtango.a
>
> io.d
> -------
>
> import tango.io.Console;
>
> void main() {
>     char[] line;
>     // true means that newlines are retained
>     while (Cin.nextLine(line, true))
>         Cout(line);
> }
>
> --------
>
> For the sake of reference, I created a file with 1.8 million (equal)  
> lines,
> at a total of 133 Megabytes. I ran it through the above program, and your
> Perl program. System is a PentiumM-1.86GHz, 1.5GB RAM, Kubuntu 7.04, DMD
> 1.009.
>
> Average times perl program : 1.65 seconds (real), 1.45 seconds (user)
> Average times tango program: 1.08 seconds (real), 0.91 seconds (user)
>
> Note that I also tried without the optimization flags to DMD, which  
> resulted
> in times that were about 10% faster than Perl.
>




More information about the Digitalmars-d mailing list