stdio performance in tango, stdlib, and perl

Lars Ivar Igesund larsivar at igesund.net
Fri Mar 23 10:37:37 PDT 2007


Andrei Alexandrescu (See Website For Email) wrote:

> Lars Ivar Igesund wrote:
>> 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);
>> }
>> 
>> --------
> 
> 5.0s          tcat
> 
> Neat! Now that we got the performance problem out of the way, let's
> discuss stdio compatibility. I suggest you use getline on GNU platforms.
> 
> Andrei

Maybe discuss first why stdio compatibility is needed? Is the equivalent
functionality missing in Tango, and if so, would implementing it in Tango
remove this need for compatibility?

Then consider the hypothetical situation where all of libc functionality
(including posix functionality currently used in Tango, system calls, etc)
is exchanged with an equivalent libd. Somewhat depending on answer above,
would same reasoning apply?

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource, #d.tango & #D: larsivi
Dancing the Tango



More information about the Digitalmars-d mailing list