I am running the following code on a Sun Solaris OS 5.7 machine.
I am compiling it with both g++ 2.95 and g++ 3.3.2, using the command:
g++ -O3 -o z z.cc
where z.cc is the following:
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
main(int argc, char** argv) {
int i = 1;
double d1 = 2.3;
double d2 = 3.4;
ofstream ofstr("zout");
for (int counter = 0; counter < 300000; counter++) {
ofstr << i << d1 << d2 << '\n';
}
ofstr.close();
}
for the 2.95 version, the job takes 2.3 seconds to run
for the 3.3.2 version, the job takes 9.5 seconds to run
Thus g++ 2.95 is 4 times faster than g++ 3.3.2.
Is this normal?
_______________________________________________
Help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus