Click here to Skip to main content
16,012,468 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: sse2 intrinsics question? Pin
Christopher Lloyd25-Jun-04 10:05
Christopher Lloyd25-Jun-04 10:05 
GeneralRe: sse2 intrinsics question? Pin
Anand RK25-Jun-04 11:20
Anand RK25-Jun-04 11:20 
GeneralRe: sse2 intrinsics question? Pin
Anand RK25-Jun-04 15:08
Anand RK25-Jun-04 15:08 
GeneralRe: sse2 intrinsics question? Pin
Christopher Lloyd25-Jun-04 15:08
Christopher Lloyd25-Jun-04 15:08 
GeneralFileDialog and ActiveX Pin
TUMB25-Jun-04 7:40
TUMB25-Jun-04 7:40 
GeneralOpen Excutable Program in VC Pin
mostafa_pasha25-Jun-04 7:34
mostafa_pasha25-Jun-04 7:34 
GeneralRe: Open Excutable Program in VC Pin
User 665825-Jun-04 7:50
User 665825-Jun-04 7:50 
Generalinline vs macro Pin
BengCésar25-Jun-04 5:10
BengCésar25-Jun-04 5:10 
I have make a test to compare a function "inline" with a macro "#define"
I compile a such code with VC 6.0 :
//-------------------------------------<br />
#define SQ(A) ((A)*(A))<br />
inline unsigned iSq(unsigned a){return a*a;}<br />
unsigned _Sq(unsigned a){return a*a;}<br />
<br />
	unsigned x,y,k(0);<br />
	unsigned long init = GetTickCount();<br />
	for(x = 10000; x--;)<br />
		for(y = 10000; y--;)<br />
			k=iSq(y);	// or SQ(y), or _Sq(y), or y*y<br />
<br />
	cout << Comment :" << GetTickCount()-init << " ms" << endl;<br />
//-------------------------------------


And I find :
inline (iSq) : 3264 ms
macro (SQ) : 391 ms
simple fct (_Sq) : 3305 ms
nothing (y*y) : 401 ms

Why inline function is so slow ?OMG | :OMG:
GeneralRe: inline vs macro Pin
Antony M Kancidrowski25-Jun-04 6:23
Antony M Kancidrowski25-Jun-04 6:23 
GeneralRe: inline vs macro Pin
David Crow25-Jun-04 6:49
David Crow25-Jun-04 6:49 
GeneralRe: inline vs macro Pin
BengCésar25-Jun-04 7:31
BengCésar25-Jun-04 7:31 
GeneralRe: inline vs macro Pin
vladfein25-Jun-04 7:57
vladfein25-Jun-04 7:57 
GeneralRe: inline vs macro Pin
David Crow25-Jun-04 7:59
David Crow25-Jun-04 7:59 
GeneralSend RST flag in the TCP Header, using Winsock API or others Pin
sundareswaran.senthilvel25-Jun-04 4:59
professionalsundareswaran.senthilvel25-Jun-04 4:59 
GeneralClasswizard Crash in Visual C++ 6 on XP Pin
kassad66625-Jun-04 4:24
kassad66625-Jun-04 4:24 
GeneralRe: Classwizard Crash in Visual C++ 6 on XP Pin
John M. Drescher25-Jun-04 4:43
John M. Drescher25-Jun-04 4:43 
GeneralRe: Classwizard Crash in Visual C++ 6 on XP Pin
kassad66625-Jun-04 5:02
kassad66625-Jun-04 5:02 
GeneralCDialogBars and buttons availability Pin
Anonymous25-Jun-04 3:56
Anonymous25-Jun-04 3:56 
GeneralCrashes in release but not in debug Pin
CptGreenwood25-Jun-04 2:40
CptGreenwood25-Jun-04 2:40 
GeneralRe: Crashes in release but not in debug Pin
David Crow25-Jun-04 4:12
David Crow25-Jun-04 4:12 
GeneralRe: Crashes in release but not in debug Pin
CptGreenwood26-Jun-04 4:51
CptGreenwood26-Jun-04 4:51 
GeneralRe: Crashes in release but not in debug Pin
PJ Arends25-Jun-04 8:15
professionalPJ Arends25-Jun-04 8:15 
QuestionHow to implement DWebBrowserEvents Pin
sundu25-Jun-04 1:51
sundu25-Jun-04 1:51 
Generaltemplate class member function - returing pointer to the class Pin
Beau Skinner25-Jun-04 1:33
Beau Skinner25-Jun-04 1:33 
GeneralRe: template class member function - returing pointer to the class Pin
Beau Skinner25-Jun-04 20:20
Beau Skinner25-Jun-04 20:20 

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.