Click here to Skip to main content
15,899,124 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: displaying bitmap in CView Pin
Tara1422-Jul-06 21:58
Tara1422-Jul-06 21:58 
AnswerRe: displaying bitmap in CView Pin
Hamid_RT23-Jul-06 2:58
Hamid_RT23-Jul-06 2:58 
GeneralRe: displaying bitmap in CView Pin
Tara1423-Jul-06 7:26
Tara1423-Jul-06 7:26 
QuestionDesign Pattern question Pin
tilemann22-Jul-06 10:10
tilemann22-Jul-06 10:10 
AnswerRe: Design Pattern question Pin
Jörgen Sigvardsson22-Jul-06 13:13
Jörgen Sigvardsson22-Jul-06 13:13 
Questionhow to mix two sound streams Pin
premium122-Jul-06 9:13
premium122-Jul-06 9:13 
AnswerRe: how to mix two sound streams Pin
premium122-Jul-06 21:26
premium122-Jul-06 21:26 
QuestionSimple Question regarding Pointer Arithmetic Pin
JKallen22-Jul-06 8:27
JKallen22-Jul-06 8:27 
I am writing a template container class similar to a vector or list. I am optimizing the class for performance not size. I want to know between the two examples relatively speaking how much faster example 2 is than 1.

Since the functionality employed within the loops is simple, it stands to reason the conditional testing (in the while clause) is relatively speaking measureable (from a performance standpoint......as compared to a loop where complex assignments are occurring.

Example 1:

T* dst1; //is pointing to legitimate memory address.
T* src1; //is pointing to legitimate memory address.
T* dst2; //is pointing to legitimate memory address.
T* src2; //is pointing to legitimate memory address.
T* stop = dst1 - 1000000; //is pointing to legitimate memory address as part of the same array dst points to.

while (dst1-- > stop){
*dst1 = *--src1;
}

stop = dst2 - 1000000;

while (dptr2-- > stop){
*dst2= *--src2;
}

Example 2:

T* dst1; //is pointing to legitimate memory address.
T* src1; //is pointing to legitimate memory address.
T* dst2; //is pointing to legitimate memory address.
T* src2; //is pointing to legitimate memory address.
T* stop = dst1 - 1000000; //is pointing to legitimate memory address as part of the same array dst points to.

while (dst1-- > stop){
*dst1= *--src1;
*--dst2= *--src2;
}

Obviously 2 is faster, but by how much?? In other words compared to the increment operations dereferencing and assigning of memory addresses, how much does the 1000000 conditional tests affect performance compared to the 1000000 of each operations occurring in the loop.

Thanks


AnswerRe: Simple Question regarding Pointer Arithmetic Pin
dnuts6922-Jul-06 22:16
dnuts6922-Jul-06 22:16 
QuestionCompositing (BitBlit etc) MFC images behind opengl [modified] Pin
adamvanner22-Jul-06 6:37
adamvanner22-Jul-06 6:37 
QuestionIPC chat application using a named pipe Pin
eeyor66622-Jul-06 6:28
eeyor66622-Jul-06 6:28 
AnswerRe: IPC chat application using a named pipe Pin
ThatsAlok23-Jul-06 21:20
ThatsAlok23-Jul-06 21:20 
GeneralRe: IPC chat application using a named pipe Pin
eeyor66624-Jul-06 5:21
eeyor66624-Jul-06 5:21 
QuestionWhen do I use StructType *& ptr [modified] Pin
WCup22-Jul-06 3:58
WCup22-Jul-06 3:58 
QuestionTo change bitmap on toolbar button Pin
anjita22-Jul-06 2:44
anjita22-Jul-06 2:44 
AnswerRe: To change bitmap on toolbar button Pin
Hamid_RT22-Jul-06 7:16
Hamid_RT22-Jul-06 7:16 
QuestionTesting a dll Pin
jon-8022-Jul-06 2:35
professionaljon-8022-Jul-06 2:35 
QuestionRe: Testing a dll Pin
Eytukan22-Jul-06 4:56
Eytukan22-Jul-06 4:56 
AnswerRe: Testing a dll Pin
Eytukan22-Jul-06 5:01
Eytukan22-Jul-06 5:01 
GeneralRe: Testing a dll Pin
Hamid_RT22-Jul-06 7:15
Hamid_RT22-Jul-06 7:15 
QuestionMFC application crash when using activex control Pin
eranre22-Jul-06 1:07
eranre22-Jul-06 1:07 
AnswerRe: MFC application crash when using activex control Pin
A_Fa22-Jul-06 1:27
A_Fa22-Jul-06 1:27 
AnswerRe: MFC application crash when using activex control Pin
Hamid_RT22-Jul-06 7:14
Hamid_RT22-Jul-06 7:14 
QuestionCreateFile API Hook [modified] Pin
capricious_00122-Jul-06 0:15
capricious_00122-Jul-06 0:15 
AnswerRe: CreateFile API Hook Pin
Stephen Hewitt22-Jul-06 0:30
Stephen Hewitt22-Jul-06 0:30 

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.