Click here to Skip to main content
15,904,339 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: OnUpdateCommand and menu Items Pin
David Crow7-Oct-05 2:58
David Crow7-Oct-05 2:58 
GeneralRe: OnUpdateCommand and menu Items Pin
#realJSOP7-Oct-05 3:05
professional#realJSOP7-Oct-05 3:05 
GeneralRe: OnUpdateCommand and menu Items Pin
David Crow7-Oct-05 3:52
David Crow7-Oct-05 3:52 
GeneralRe: OnUpdateCommand and menu Items Pin
#realJSOP7-Oct-05 6:54
professional#realJSOP7-Oct-05 6:54 
AnswerRe: OnUpdateCommand and menu Items Pin
David Crow7-Oct-05 8:10
David Crow7-Oct-05 8:10 
GeneralRe: OnUpdateCommand and menu Items Pin
#realJSOP7-Oct-05 9:10
professional#realJSOP7-Oct-05 9:10 
AnswerRe: OnUpdateCommand and menu Items Pin
Michael Dunn7-Oct-05 9:10
sitebuilderMichael Dunn7-Oct-05 9:10 
Questionobj versus &obj - performance test Pin
ddmcr7-Oct-05 2:08
ddmcr7-Oct-05 2:08 
Hello guys,
I have next strange situation :
I have a function

CString Add(CString var1,CString var2)
{
..
}


which i use for adding two huge integers.

then for example I declare two variables :

CString x = "457235872349857348957238945723894579234896234789563";
CString y = "573489573894573894579234852378456782345683475683746";


then add them , for example 1000 times

while(/**/)
{
..
Add(x,y);
..
}


It takes my computer aproximately 5 seconds to do these calculations.
But then i decided to modify the Add function like this :
CString Add(CString & var1,CString & var2)
{
..
}


I expected that the calculations would be faster as no copy objects would be created in this case inside Add function , as I was passing directly addresses.
But the result is opposite

Can anybody explain why ??



"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill


AnswerRe: obj versus &obj - performance test Pin
vikas amin7-Oct-05 2:16
vikas amin7-Oct-05 2:16 
GeneralRe: obj versus &obj - performance test Pin
ddmcr7-Oct-05 2:23
ddmcr7-Oct-05 2:23 
QuestionRe: obj versus &obj - performance test Pin
toxcct7-Oct-05 2:47
toxcct7-Oct-05 2:47 
GeneralRe: obj versus &obj - performance test Pin
ddmcr7-Oct-05 2:53
ddmcr7-Oct-05 2:53 
GeneralRe: obj versus &obj - performance test Pin
toxcct7-Oct-05 2:58
toxcct7-Oct-05 2:58 
GeneralRe: obj versus &obj - performance test Pin
ddmcr7-Oct-05 3:06
ddmcr7-Oct-05 3:06 
AnswerRe: obj versus &obj - performance test Pin
toxcct7-Oct-05 3:15
toxcct7-Oct-05 3:15 
GeneralRe: obj versus &obj - performance test Pin
Maximilien7-Oct-05 3:19
Maximilien7-Oct-05 3:19 
GeneralRe: obj versus &obj - performance test Pin
ddmcr7-Oct-05 3:24
ddmcr7-Oct-05 3:24 
AnswerRe: obj versus &obj - performance test ( edited with more results : Pin
Maximilien7-Oct-05 2:59
Maximilien7-Oct-05 2:59 
GeneralRe: obj versus &obj - performance test Pin
ddmcr7-Oct-05 3:02
ddmcr7-Oct-05 3:02 
GeneralRe: obj versus &obj - performance test ( edited with more results : Pin
ddmcr7-Oct-05 4:17
ddmcr7-Oct-05 4:17 
AnswerRe: obj versus &obj - performance test Pin
S. Senthil Kumar7-Oct-05 3:19
S. Senthil Kumar7-Oct-05 3:19 
AnswerRe: obj versus &obj - performance test Pin
Tim Smith7-Oct-05 3:56
Tim Smith7-Oct-05 3:56 
QuestionCStatic Drawing Pin
Jagadeesh VN7-Oct-05 1:45
Jagadeesh VN7-Oct-05 1:45 
QuestionMenu border Pin
hatemtaleb7-Oct-05 1:38
hatemtaleb7-Oct-05 1:38 
AnswerRe: Menu border Pin
toxcct7-Oct-05 1:41
toxcct7-Oct-05 1:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.