Groups | Blog | Home
all groups > vb.net > february 2005 >

vb.net : Inline functions



kd
2/27/2005 11:49:05 PM
Hi All,

Does vb.net support inline functions?

kd.

kd
2/28/2005 2:39:03 AM
Cor,

I have a procedure which has few lines of code that I need to execute very
frequently in the project. If the procedure were to be 'Inline', the
overheads of a function call can be eliminated.

If there is something like an 'Inline' function available in vb.net, I could
use that feature.

Thanks.
kd

[quoted text, click to view]
Brian Gideon
2/28/2005 6:43:48 AM
kd,

The JIT compiler will automatically inline small methods. I believe
the threshold is 32 bytes. Simple properties are ideal candidates.
One advantage of letting the JIT compiler do this automatically is that
it can inline methods across assembly boundaries.

Brian

[quoted text, click to view]
Cor Ligthert
2/28/2005 10:12:04 AM
KD,

[quoted text, click to view]

Can you explain why you ask this in the context of the language.vb?

Cor

Cor Ligthert
2/28/2005 11:56:23 AM
KD,

In my opinion do we not live anymore in the century from the invention of
the Unix computer.

You can be sure that using ILS language the processing is not direct, as it
is with almost every computersystem invented after 1960. (Not about
processors for coocking machines and things like that).

How many cycles of the processor you need to win?

You know that a computer needed for Net has at least something as 90Mhz.

What means 90 million cycles per second.

Cor


Brian Cryer
2/28/2005 1:02:41 PM
[quoted text, click to view]

I've never seen any reference to it.

However, I think that the compiler makes the call whether to inline the
function and its not something you have explicit control over. This is based
on what little information I could find on the net.

Hope this helps,

Brian

www.cryer.co.uk/brian

Herfried K. Wagner [MVP]
2/28/2005 1:44:15 PM
"kd" <kd@discussions.microsoft.com> schrieb:
[quoted text, click to view]

Some of the VB functions are inlined by the compiler. The JITter will
inline small functions automatically. However, you don't have control over
this process, which gives the JITter more flexibility to optimize your code.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
AddThis Social Bookmark Button