470,849 Members | 686 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

VC8 program writing to cout much slower than VC6 program

hi, i have the following piece of code in a program compiled using both VC8
and VC6. it basically just writes out two arrays to cout.
the VC6 program takes about 4 seconds to go through that bit of code whereas
the VC8 program takes almost 18 seconds !
can someone tell me why this is so ? is this common?

thanks,
Julian.

(numberOfEquations= 15711)

int ic;
ic=0;
for(int j=0; j<numberOfEquations; j++)
{ic +=1;
cout<<loadVector[j]<<FORMAT;
if(ic==10) { ic=0; cout<<endl;}
}cout<<endl;
cout<<"pseudoLoadVector"<<endl;
ic=0;
for( j=0; j<numberOfEquations; j++)
{ic +=1;
cout<<pseudoLoadVector[j]<<FORMAT;
if(ic==10) { ic=0; cout<<endl;}
}cout<<endl;
Jul 22 '06 #1
8 1096
hi, i have the following piece of code in a program compiled using both
VC8 and VC6. it basically just writes out two arrays to cout.
the VC6 program takes about 4 seconds to go through that bit of code
whereas the VC8 program takes almost 18 seconds !
can someone tell me why this is so ? is this common?

thanks,
Julian.

(numberOfEquations= 15711)

int ic;
ic=0;
for(int j=0; j<numberOfEquations; j++)
{ic +=1;
cout<<loadVector[j]<<FORMAT;
if(ic==10) { ic=0; cout<<endl;}
}cout<<endl;
cout<<"pseudoLoadVector"<<endl;
ic=0;
for( j=0; j<numberOfEquations; j++)
{ic +=1;
cout<<pseudoLoadVector[j]<<FORMAT;
if(ic==10) { ic=0; cout<<endl;}
}cout<<endl;
Maybe an obvious question, but were both release builds?

--

Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"
Jul 23 '06 #2
Julian wrote:
hi, i have the following piece of code in a program compiled using both VC8
and VC6. it basically just writes out two arrays to cout.
the VC6 program takes about 4 seconds to go through that bit of code whereas
the VC8 program takes almost 18 seconds !
can someone tell me why this is so ? is this common?

thanks,
Julian.

(numberOfEquations= 15711)

int ic;
ic=0;
for(int j=0; j<numberOfEquations; j++)
{ic +=1;
cout<<loadVector[j]<<FORMAT;
if(ic==10) { ic=0; cout<<endl;}
}cout<<endl;
cout<<"pseudoLoadVector"<<endl;
ic=0;
for( j=0; j<numberOfEquations; j++)
{ic +=1;
cout<<pseudoLoadVector[j]<<FORMAT;
if(ic==10) { ic=0; cout<<endl;}
}cout<<endl;

Maybe this is a problem with the speed of console. Did you take those
readings on the same computer ?

My Windows computer at work for some reason is terribly slow writing to
the console (in Windows). It's a Pentium 4 2.6G HT but you can almost
see the console refreshing from top to bottom when scrolling.
Jul 23 '06 #3
Hi Julian!
hi, i have the following piece of code in a program compiled using both VC8
and VC6. it basically just writes out two arrays to cout.
the VC6 program takes about 4 seconds to go through that bit of code whereas
the VC8 program takes almost 18 seconds !
Is the VC6 also using the multi-threaded CRT?
Also there is a small performance hit in VC8; which will be seen in
"non-real-world" test cases as your example...
See:
http://www.codeproject.com/cpp/improved2005crt.asp

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Jul 23 '06 #4
Hi Jochen,

A nice article, thanks. Just a small note:
You probably meant x64 there. IA-64 is Itanuim.
Intel calls it's AMD64 compatible processors "Intel 64" - as they say,
to avoid confusion...

Regards,
-PA

"Jochen Kalmbach [MVP]" wrote:
Hi Julian!
hi, i have the following piece of code in a program compiled using both VC8
and VC6. it basically just writes out two arrays to cout.
the VC6 program takes about 4 seconds to go through that bit of code whereas
the VC8 program takes almost 18 seconds !

Is the VC6 also using the multi-threaded CRT?
Also there is a small performance hit in VC8; which will be seen in
"non-real-world" test cases as your example...
See:
http://www.codeproject.com/cpp/improved2005crt.asp

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Jul 23 '06 #5
Hi Pavel!
A nice article, thanks. Just a small note:
You probably meant x64 there. IA-64 is Itanuim.
Intel calls it's AMD64 compatible processors "Intel 64" - as they say,
to avoid confusion...
I don't understand what is confusing you...

The "bug" is present in x86 and IA64 implementation of the CRT.

It is *not* present in x64!

By the way: The problem is solved in SP1!

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Jul 23 '06 #6

"Bruno van Dooren [MVP VC++]" <br**********************@hotmail.comwrote
in message news:OZ**************@TK2MSFTNGP02.phx.gbl...
>hi, i have the following piece of code in a program compiled using both
VC8 and VC6. it basically just writes out two arrays to cout.
the VC6 program takes about 4 seconds to go through that bit of code
whereas the VC8 program takes almost 18 seconds !
can someone tell me why this is so ? is this common?

thanks,
Julian.

(numberOfEquations= 15711)

int ic;
ic=0;
for(int j=0; j<numberOfEquations; j++)
{ic +=1;
cout<<loadVector[j]<<FORMAT;
if(ic==10) { ic=0; cout<<endl;}
}cout<<endl;
cout<<"pseudoLoadVector"<<endl;
ic=0;
for( j=0; j<numberOfEquations; j++)
{ic +=1;
cout<<pseudoLoadVector[j]<<FORMAT;
if(ic==10) { ic=0; cout<<endl;}
}cout<<endl;

Maybe an obvious question, but were both release builds?

--

Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"
yeah, i compared the two release builds against each other and the two debug
builds against each other.. same behavior. (on the same computer)
Jul 23 '06 #7

"Roman Ziak" <ne****@ziak.comwrote in message
news:H6*******************@read1.cgocable.net...
Julian wrote:
>hi, i have the following piece of code in a program compiled using both
VC8
and VC6. it basically just writes out two arrays to cout.
the VC6 program takes about 4 seconds to go through that bit of code
whereas
the VC8 program takes almost 18 seconds !
can someone tell me why this is so ? is this common?

thanks,
Julian.

(numberOfEquations= 15711)

int ic;
ic=0;
for(int j=0; j<numberOfEquations; j++)
{ic +=1;
cout<<loadVector[j]<<FORMAT;
if(ic==10) { ic=0; cout<<endl;}
}cout<<endl;
cout<<"pseudoLoadVector"<<endl;
ic=0;
for( j=0; j<numberOfEquations; j++)
{ic +=1;
cout<<pseudoLoadVector[j]<<FORMAT;
if(ic==10) { ic=0; cout<<endl;}
}cout<<endl;


Maybe this is a problem with the speed of console. Did you take those
readings on the same computer ?

My Windows computer at work for some reason is terribly slow writing to
the console (in Windows). It's a Pentium 4 2.6G HT but you can almost
see the console refreshing from top to bottom when scrolling.
yes, readings were from the same computer.
its a P4 2Ghz, 1GB RAM
Jul 23 '06 #8

"Jochen Kalmbach [MVP]" <no********************@holzma.dewrote in message
news:Oc**************@TK2MSFTNGP02.phx.gbl...
Hi Julian!
>hi, i have the following piece of code in a program compiled using both
VC8 and VC6. it basically just writes out two arrays to cout.
the VC6 program takes about 4 seconds to go through that bit of code
whereas the VC8 program takes almost 18 seconds !

Is the VC6 also using the multi-threaded CRT?
Also there is a small performance hit in VC8; which will be seen in
"non-real-world" test cases as your example...
See:
http://www.codeproject.com/cpp/improved2005crt.asp
earlier, the VC6 version was single-threaded.
After reading your post, I rebuilt the VC6 version as Multi-threaded DLL
(which is what the VC8 version is) but I still get the same performance
issue.
Jul 23 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Minti | last post: by
13 posts views Thread by vgame64 | last post: by
12 posts views Thread by asif929 | last post: by
11 posts views Thread by Ground21 | last post: by
reply views Thread by Frank Birbacher | last post: by
1 post views Thread by jerry | last post: by
1 post views Thread by culture | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.