Colin B Maharaj
2008-08-05 07:18:55 UTC
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 080804-0, 08/04/2008), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 190.58.103.87
Message-ID: <4897fedf$***@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1217920735 190.58.103.87 (5 Aug 2008 00:18:55 -0700)
Lines: 48
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
Bytes: 1602
Xref: number1.nntp.dca.giganews.com borland.public.cppbuilder.language.cpp:20972
Remember this code is hypothetical.
Say I have a class like this...
class TMyClass
{
public:
TMyClass();
~TMyClass();
void bar();
private:
void foo();
};
// Then....
TMyClass::TMyClass() { }
TMyClass::~TMyClass() { }
void TMyClass::foo() { }
// Then all of a sudden...
void fastmanip(int & y)
{
int x = y;
asm
{
mov eax, x
shl eax, 1
mov x, eax
}
y = x
}
void TMyClass::bar()
{
int w;
fastmanip(w);
}
Question:
Seeing how I called a function that was just there, not part of the
class, how does this affect the performance. Is there any overhead
of calling this code if it were not part of the class? Should I put
it in the class?
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 080804-0, 08/04/2008), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 190.58.103.87
Message-ID: <4897fedf$***@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1217920735 190.58.103.87 (5 Aug 2008 00:18:55 -0700)
Lines: 48
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
Bytes: 1602
Xref: number1.nntp.dca.giganews.com borland.public.cppbuilder.language.cpp:20972
Remember this code is hypothetical.
Say I have a class like this...
class TMyClass
{
public:
TMyClass();
~TMyClass();
void bar();
private:
void foo();
};
// Then....
TMyClass::TMyClass() { }
TMyClass::~TMyClass() { }
void TMyClass::foo() { }
// Then all of a sudden...
void fastmanip(int & y)
{
int x = y;
asm
{
mov eax, x
shl eax, 1
mov x, eax
}
y = x
}
void TMyClass::bar()
{
int w;
fastmanip(w);
}
Question:
Seeing how I called a function that was just there, not part of the
class, how does this affect the performance. Is there any overhead
of calling this code if it were not part of the class? Should I put
it in the class?