Click here to Skip to main content
15,894,646 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CListCtrl and lParam Pin
t2x16-Feb-06 1:19
t2x16-Feb-06 1:19 
GeneralRe: CListCtrl and lParam Pin
Dan McCormick16-Feb-06 6:18
Dan McCormick16-Feb-06 6:18 
QuestionCan STL vector cross DLL boundaries? Pin
unjedai14-Feb-06 8:30
unjedai14-Feb-06 8:30 
AnswerRe: Can STL vector cross DLL boundaries? Pin
Michael Dunn14-Feb-06 10:14
sitebuilderMichael Dunn14-Feb-06 10:14 
AnswerRe: Can STL vector cross DLL boundaries? Pin
Jeff Thompson14-Feb-06 10:17
Jeff Thompson14-Feb-06 10:17 
AnswerRe: Can STL vector cross DLL boundaries? Pin
Stephen Hewitt14-Feb-06 11:28
Stephen Hewitt14-Feb-06 11:28 
AnswerRe: Can STL vector cross DLL boundaries? Pin
Anthony_Yio14-Feb-06 15:37
Anthony_Yio14-Feb-06 15:37 
QuestionStrange variations Pin
hint_5414-Feb-06 8:27
hint_5414-Feb-06 8:27 
Assume the following code:

#CODEBEGINS
int main( void )
{
CCPU CPU; // For CPU querys
HLint64 Begin, End; // To keep CPU times
int i, j; // Counters

tVar<int> *tvTest; // Test material


for ( i=1 ; i<500 ; i++ ) {

for ( j=0 ; j<i ; j++ ) {

// Begin counting
Begin = CPU.rdtsc();

tvTest = new tVar<int>;
delete tvTest;

// Stop counting
End = CPU.rdtsc();

// Calculations & output
printf( "[%d:%d]:(delta)TSC: %ld\n", i, j, ( End.Hi - Begin.Hi ) + ( End.Lo - Begin.Lo ) );
}

putchar( '\n' );
}


return 0;
}
#CODEENDS

This is suppose to test how fast the computer allocs and frees a class (note: this class has no constructor). I got the following results:

[1Blush | :O ]:(delta)TSC: 3234
[2Blush | :O ]:(delta)TSC: 1385
[2:1]:(delta)TSC: 1212
[3:1]:(delta)TSC: 1189
[45:10]:(delta)TSC: 1230
[48:37]:(delta)TSC: 1240
[52:4]:(delta)TSC: 1571
[53:6]:(delta)TSC: 409762 // WOW!
[53:7]:(delta)TSC: 1375
[55:10]:(delta)TSC: 1296
[58:7]:(delta)TSC: 1239
[448:338]:(delta)TSC: 1177 // Almost all not shown so far are 1177
[448:339]:(delta)TSC: 10015
[448:340]:(delta)TSC: 1263
[448:341]:(delta)TSC: 1157
[448:342]:(delta)TSC: 1194 // Almost all from now on are 1194 (this only happned in one of the tests, all the others still had a HUGE majority of 1177)

Can anyone explain these small (sometimes not that small!) variations?

regards


hint_54

-- modified at 14:27 Tuesday 14th February, 2006

Oh.. I forgot, assume this is the CPU.rdtsc() function:
HLint64 CCPU::rdtsc( void )
{
HLint64 i64StampRead;

// Read time stamp counter
__asm {
rdtsc; // ReaD Time Stamp Counter

mov [i64StampRead.Lo], eax // Copy the low DWORD
mov [i64StampRead.Hi], edx // Copy the high DWORD
}

return i64StampRead;
}

regards, once again Wink | ;)
AnswerRe: Strange variations Pin
David Crow14-Feb-06 9:46
David Crow14-Feb-06 9:46 
GeneralRe: Strange variations Pin
hint_5415-Feb-06 6:22
hint_5415-Feb-06 6:22 
AnswerRe: Strange variations Pin
Stephen Hewitt14-Feb-06 11:34
Stephen Hewitt14-Feb-06 11:34 
AnswerRe: Strange variations Pin
Dan McCormick14-Feb-06 13:37
Dan McCormick14-Feb-06 13:37 
GeneralRe: Strange variations Pin
hint_5415-Feb-06 5:36
hint_5415-Feb-06 5:36 
NewsRe: Strange variations Pin
Dan McCormick15-Feb-06 11:10
Dan McCormick15-Feb-06 11:10 
QuestionFormat of data in writing file , on different Windows Pin
zahid_ash14-Feb-06 8:14
zahid_ash14-Feb-06 8:14 
AnswerRe: Format of data in writing file , on different Windows Pin
Red Stateler14-Feb-06 8:57
Red Stateler14-Feb-06 8:57 
QuestionSerial port interfacing Pin
srija14-Feb-06 7:02
srija14-Feb-06 7:02 
AnswerRe: Serial port interfacing Pin
Milton Karimbekallil14-Feb-06 8:16
Milton Karimbekallil14-Feb-06 8:16 
AnswerRe: Serial port interfacing Pin
Dan McCormick14-Feb-06 8:29
Dan McCormick14-Feb-06 8:29 
QuestionWinsock2.h and "unresolved external error" Pin
Mutty14-Feb-06 6:53
Mutty14-Feb-06 6:53 
AnswerRe: Winsock2.h and "unresolved external error" Pin
James R. Twine14-Feb-06 6:57
James R. Twine14-Feb-06 6:57 
GeneralRe: Winsock2.h and &quot;unresolved external error&quot; Pin
Mutty14-Feb-06 7:23
Mutty14-Feb-06 7:23 
GeneralRe: Winsock2.h and "unresolved external error" Pin
ThatsAlok14-Feb-06 22:22
ThatsAlok14-Feb-06 22:22 
AnswerRe: Winsock2.h and "unresolved external error" Pin
David Crow14-Feb-06 7:00
David Crow14-Feb-06 7:00 
Questioninlining problem Pin
hint_5414-Feb-06 6:21
hint_5414-Feb-06 6:21 

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.