stdio performance in tango, stdlib, and perl
Walter Bright
newshound at digitalmars.com
Wed Mar 21 17:50:16 PDT 2007
kris wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> kris wrote:
> [snip]
>>> Tango should still come out in front, although I have to say that
>>> benchmarks don't really tell very much in general i.e. doesn't mean
>>> much of anything important whether tango "wins" this or not (IMO)
>>
>>
>> Why not?
>
> If tango were terribly terribly slow instead, then it would be cause for
> concern. If I have some program that needs to run faster I'll find a way
> to do just that; another reason why tango.io is fairly modular
One problem with C++, as I mentioned before, is that the
straightforward, out of the box coding techniques don't get you fast
code. One of my goals with D is to fix that - the straightforward,
untuned code should get you most of the possible speed. I think the wc
benchmark shows this off.
Having to recode one's programs to speed them up is a big productivity
sapper. (The most egregious examples of this are people forced to recode
bits of their python/java/ruby app in C++.)
What makes stdio so worth the effort to speed up is because the payoff
is evident in 80-90% of the programs out there. Optimizing your own
program speeds up only your own program - optimizing the library speeds
everyone up.
Tango doesn't need to be terribly, terribly slow to be a cause for
concern. It only needs to be slower than C++/Perl/Java to be a problem,
because then it is a convenient excuse for people to not switch to D.
The conventional wisdom with C++ is that:
1) C++ code is inherently faster than in any other language
2) iostream has a great design
3) iostream is uber fast because it uses templates to inline everything
Andrei's benchmark blows that out of the water. Even interpreted Perl
beats the pants off of C++ iostreams.
More information about the Digitalmars-d
mailing list