stdio performance in tango, stdlib, and perl

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


kris wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
> [snip]
>> Oh, but I forgot it's cheating: uses read/write so it's incompatible 
>> with C's stdio, which phobos is.
> 
> How can it possibly be "cheating" when the code was in place before you 
> contrived this test ;)
> 
> I think you have to stretch a bit to find some /common/ and truly valid 
> cases where what you refer to is important enough to warrant such 
> attention.
> 
> If it truly were to become an issue (people actually run into problems 
> with it on a regular basis) then tango.io could be changed to 
> special-case this kind of thing; but at this time we prefer to avoid 
> such things and adhere to the KISS principal instead.

"Principle" I guess. That sounds great. My opinion in the matter is 
simple - D's stdio use C's FILE*, stdio lib, and all. Moreover, it gives 
the programmer full access to them. It would be only nice, if it does 
not cost too much, to not be gratuitously incompatible with them. That's 
all. If you want to take the other route, you better disable access to 
C's getchar et al.

> FWIW, tango.io could trivially be sped up significantly on this 'test' 
> -- as it stands, the implementation is quite pedestrian in nature ;)

The 'test' is not a 'test', it's a test deriving from my attempts to 
find the bottleneck in a real D program.


Andrei



More information about the Digitalmars-d mailing list