473,385 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1231
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Minti | last post by:
Is std::cout slower than printf When we call printf e.g. in printf(20 format conversion specifications, 20 arguments); Is it faster than the std::cout << { 20 redirections to the output...
20
by: Mark | last post by:
I am using gnu g++ version 3.3.2, trying a simple test to read in and then write out a large (100,000 line) text file ########################################## CSTDIO VERSION TO READ/WRITE...
13
by: vgame64 | last post by:
Hi, I have been struggling with writing a program for a few hours. The requirements are that: """You will be writing a program which will determine whether a date is valid in terms of days in that...
12
by: asif929 | last post by:
I am trying to write a program which creates four triangles. The program begins with prompting a user " Enter the size of triangles", number from 1 to N is the size of four triangles For Example if...
11
by: Ground21 | last post by:
Hello. I'm new // sorry for my english :) I have to write simple program i c++. But I don't know how to code src - program should know it's name (unit1.exe so the name is "unit1" or "unit1.exe"...
14
by: xtheendx | last post by:
I am writing a gradbook type program. It first allows the user to enter the number of students they want to enter. then allows them to enter the first name, last name, and grade of each student. The...
0
by: Frank Birbacher | last post by:
Hi! sphenxes@gmail.com schrieb: Why is the referenceNumber a string? Are there always *exactly* six alternatives? The alternatives could be a std::deque which can resize as needed.
1
by: jerry | last post by:
i have written a simple phonebook program,i'll show you some of the codes,the program's head file is member.h . i suppose the head file works well.so i don't post it. here's the clips of main...
1
by: culture | last post by:
My code is pasted at the bottom I am writing a program that gives a user four (4 options) 1) Reorder Sentence 2) Sentence Encryption 3) Count Vowels 4) Quit My problem is that I have...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.