libstdc++/2211
Paolo Carlini
pcarlini@unitus.it
Wed Jun 27 14:28:00 GMT 2001
Hi all,
Benjamin, I have just read your reply concerning the use of
std::ios::sync_with_stdio(false).
Therefore I tried my favorite test, that is a short program from the 2nd
Ed. of Programming Pearls by Jon Bentley:
-----------
/* Copyright (C) 1999 Lucent Technologies */
/* From 'Programming Pearls' by Jon Bentley */
/* wordlist.cpp -- Sorted list of words (between white space) in file */
#include <iostream>
#include <set>
#include <string>
using namespace std;
int main()
{
set<string> S;
string t;
set<string>::iterator j;
while (cin >> t)
S.insert(t);
for (j = S.begin(); j != S.end(); ++j)
cout << *j << "\n";
return 0;
}
------------
On my Linux-x86 box, I don't see significant speed differences bring
about by std::ios::sync_with_stdio(false).
Indeed, I always see a significant run time regression vs libstdc++v2
(between 2x and 3x, unfortunately) when processing a long test file
(usually I use electronic version of "The King James Bible", 4445260
chars, for this purpose)
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2211&database=gcc
More information about the Gcc-bugs
mailing list