stdio performance in tango, stdlib, and perl
kris
foo at bar.com
Wed Mar 21 16:37:21 PDT 2007
Andrei Alexandrescu (See Website For Email) wrote:
[snip]
> (C++ makes the same mistake wrt newline.)
>
> 35.7s cppcat
>
> I seem to remember a trick that puts some more wind into iostream's
> sails, so I tried that as well:
>
> #include <string>
> #include <iostream>
> using namespace std;
>
> int main() {
> cin.sync_with_stdio(false);
> cout.sync_with_stdio(false);
> string s;
> while (getline(std::cin, s)) {
> cout << s << '\n';
> }
> }
>
> Result:
>
> 13.3s cppcat
Out of interest, how does the currently shipping Phobos fare in this test?
More information about the Digitalmars-d
mailing list