By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,182 Members | 1,418 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,182 IT Pros & Developers. It's quick & easy.

Inlining?

P: n/a
From what I can tell, VB.NET doesn't allow programmers to say
explicitly that they want a function to be inlined. Now, I'm a big fan
of factoring out duplicate code, but I don't want to do too much of it
in VB if there's going to be a noticeable performance hit. So:

1. Does the VB compiler sometimes inline simple functions?
2. Is there much of a performance hit on a function call?

Thanks.
Jul 17 '05 #1
Share this Question
Share on Google+
17 Replies


P: n/a
I use VB5, so this answer may be open to debate. This is how VB4+5+6 work:
1. Does the VB compiler sometimes inline simple functions? Depends on the compilation options in the project properties. You can change
it to
Fast Code
Does a lot of inlining, especially smaller functions and this may cause a
large EXE file to be produced.
Small Code
This factors the functions, which is the opposite to inlining. It basically
finds similar code and puts them into a function wherever possible to save
space.
No Optimization
Leaves the program exactly how it is. It does no inlining, factorising, or
other manipulation along those lines.
2. Is there much of a performance hit on a function call?

Depends on the processing power and speed of the program. In a short
program, factorising or inlining will do nothing to the speed of execution.
In a larger or repetitive program, it can change the speed. Factoring
(calling more functions) spends more time pushing and popping the stack and
calling other functions. Inlining (inserting functions in line with the
code) is faster, but it does create more file size.
This is one trade off programmers has to think about when creating a robust,
fast system. I find it better to use my own judgement and use No
Optimization so that I can set how much factoring/inlining occurs.

Hope this helps.

--
QuickHare
(Qu**********@HEREHotmail.com)
Remove the NOT and HERE to E-Mail direct.
Enleve les NOT et HERE E-Mail moi directement.
Jul 17 '05 #2

P: n/a
Almost everybody here is using VB6 or lower. While you may get a stray
answer to VB.NET questions here, you should ask them in newsgroups devoted
exclusively to .NET programming. Look for newsgroups with the word "dotnet"
in their name.

For the news.devx.com news server, try these

vb.dotnet.discussion
vb.dotnet.technical

For the microsoft news server, try these newsgroups...

microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb

There are some others, but these should get you started.

Rick - MVP


"Tony Vitonis" <no***@nowhere.com> wrote in message
news:jx********************@comcast.com...
From what I can tell, VB.NET doesn't allow programmers to say
explicitly that they want a function to be inlined. Now, I'm a big fan
of factoring out duplicate code, but I don't want to do too much of it
in VB if there's going to be a noticeable performance hit. So:

1. Does the VB compiler sometimes inline simple functions?
2. Is there much of a performance hit on a function call?

Thanks.

Jul 17 '05 #3

P: n/a
Wow. Only three days monitoring the newsgroup, and I've already found
somebody to put in my kill file.

Best of luck in your VB.NET policing endeavor, Rick. I for one intend
to continue asking such questions, and to continue responding to them
when other people ask them. Bye now. *click*
ri************@NOSPAMcomcast.net says...

Almost everybody here is using VB6 or lower. While you may get a stray
answer to VB.NET questions here, you should ask them in newsgroups devoted
exclusively to .NET programming. Look for newsgroups with the word "dotnet"
in their name.

For the news.devx.com news server, try these

vb.dotnet.discussion
vb.dotnet.technical

For the microsoft news server, try these newsgroups...

microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb

There are some others, but these should get you started.
Tony Vitonis wrote...

From what I can tell, VB.NET doesn't allow programmers to say
explicitly that they want a function to be inlined. Now, I'm a big
fan of factoring out duplicate code, but I don't want to do too
much of it in VB if there's going to be a noticeable performance
hit. So:

1. Does the VB compiler sometimes inline simple functions?
2. Is there much of a performance hit on a function call?

Thanks.

Jul 17 '05 #4

P: n/a
> Wow. Only three days monitoring the newsgroup

"Wow" is right... I've been volunteering answers on VB newsgroups for more
than 3 years now; I watched Microsoft set up the "dotnet" newsgroups on
their own servers in order to handle the .NET questions directly; I watched
other news servers follow suit and do the same... and in just 3 days,
**you** determined they were wrong to have done so because **you** found at
least a newsgroup with the word "visual" and "basic" in it and you just
**know** that it was meant to service VB.NET questions in addition to those
for which it was originally created. Congratulations on your marvelous
powers of insight; you should apply for a job at Microsoft... they obviously
could use someone as gifted as you to fill in

and I've already found somebody to put in my kill file.
Please do... no VB6 type answer I would give to a VB.NET question you might
ask would be the correct way to code it in VB.NET. Also, kill-filing me
would stop you from continually having to see my standard response to VB.NET
questions posted here in the VB **classic** newsgroups.

Best of luck in your VB.NET policing endeavor, Rick.
I don't need any luck. I post messages here, and in other VB classic
newsgroups confident knowing that Microsoft finds my activities to be
helpful and useful (the MVP designation you see me sign my posts with is a
direct result of having received just such an award by Microsoft; see
http://mvp.support.microsoft.com/ for more details).

I for one intend to continue asking such questions
This is an unmoderated newsgroup, so there is no one who can stop you from
doing so. Strange, though, that you would want to continually parade your
disdain for the rest of the non-dotnet group by doing so. Try logging into
the news.devx.com news server and posting your question on either their
vb.general or vb.getting.started newsgroups and watch the moderator of that
group (Phil Weber) move your post to one of the dotnet newsgroups while
advising you that these groups are for VB6 or lower.

and to continue responding to them when other people ask them.


This is fine to do... if someone asks a dotnet question, and you know the
answer, by all means, answer it. The only thing I'd like to see you do then
is suggest they ask additional questions in the newsgroups created specially
to handle questions for the dotnet line of products (which I presume you
monitor also). Unfortunately, you have decided not to do this; so I will
continue posting the message that I did when you first posted your question,
so that these individuals will know of a location better able to handle
their questions.
Rick - MVP
Jul 17 '05 #5

P: n/a
> > Wow. Only three days monitoring the newsgroup

"Wow" is right... I've been volunteering answers on VB newsgroups for more
than 3 years now; I watched Microsoft set up the "dotnet" newsgroups on
their own servers in order to handle the .NET questions directly; I watched other news servers follow suit and do the same... and in just 3 days,
**you** determined they were wrong to have done so because **you** found at least a newsgroup with the word "visual" and "basic" in it and you just
**know** that it was meant to service VB.NET questions in addition to those for which it was originally created. Congratulations on your marvelous
powers of insight; you should apply for a job at Microsoft... they obviously could use someone as gifted as you to fill in
<SNIP>
and to continue responding to them when other people ask them.


This is fine to do... if someone asks a dotnet question, and you know the
answer, by all means, answer it. The only thing I'd like to see you do

then is suggest they ask additional questions in the newsgroups created specially to handle questions for the dotnet line of products (which I presume you
monitor also). Unfortunately, you have decided not to do this; so I will
continue posting the message that I did when you first posted your question, so that these individuals will know of a location better able to handle
their questions.


I'm with Rick on this one. There are much better newsgroups to ask about
..NET topics, hence why I said in my reply "I use VB5", "This is how VB4+5+6
work". It would have been much nicer to just take Rick's reply and just ask
the right people. Talking about a kill file will get people's backs up,
least of all mine. Those who start insulting after being told a small point
like Rick's means they know they're in the wrong.
I, too, have been casually replying to people's questions and comments for
years, and I know that we very rarely get .NET questions, and those we do we
usually send them off to a newsgroup that can reply properly. We do them a
favour instead o them searching for yet more newsgroups. Monitoring this
newsgroup, for however long, will show you how little .NET questions and
answers we actually get, and therefore some kind of bell should have rung in
your head to point you towards the newsgroups with the words "Visual"
"Basic" AND "Net" if you saw them. They have descriptive names for a reason.
I hope you find a newsgroup that can reply to your question, and rest
assured you won't be getting many people asking questions about .NET
products in this newsgroup, which means you don't have to keep monitoring
our group for them, let alone reply to anybody.

--
QuickHare
(Qu**********@HEREHotmail.com)
Remove the NOT and HERE to E-Mail direct.
Enleve les NOT et HERE E-Mail moi directement.
Jul 17 '05 #6

P: n/a
On Tue, 14 Oct 2003 10:32:03 -0400, Tony Vitonis <no***@nowhere.com>
wrote:
Wow. Only three days monitoring the newsgroup, and I've already found
somebody to put in my kill file.

Best of luck in your VB.NET policing endeavor, Rick. I for one intend
to continue asking such questions, and to continue responding to them
when other people ask them. Bye now. *click*


Following your logic, I shall start using this NG for asking questions
abut Kylix

I suggest that we all find esoteric subjects that are totally off
topic, and start posting questions on them here.

BTW if Rick did not politely point dot.netters in the right direction,
then others of us would ask them to bog off
- far less politely
Jul 17 '05 #7

P: n/a
You're free to ask whatever questions you like, of course. As am I.
And if I'm told to bog off, then I'll just add another entry to my
kill file. Couldn't be simpler.

Have a nice day! =c)
er*****@nowhere.com says...

Following your logic, I shall start using this NG for asking
questions abut Kylix

I suggest that we all find esoteric subjects that are totally off
topic, and start posting questions on them here.

BTW if Rick did not politely point dot.netters in the right
direction, then others of us would ask them to bog off - far less
politely
Tony Vitonis wrote:

Wow. Only three days monitoring the newsgroup, and I've already
found somebody to put in my kill file.

Best of luck in your VB.NET policing endeavor, Rick. I for one
intend to continue asking such questions, and to continue
responding to them when other people ask them. Bye now. *click*

Jul 17 '05 #8

P: n/a
As I said, I intend to keep asking questions wherever there's a chance
that I'll get a good reply. I think it's a perfectly good practice,
and I'll killfile anyone who tries to berate me for it (Rick, e.g.) --
not because I "know I'm in the wrong", but because I won't have my
news data cluttered with vitriol from insecure small-minded children.

Thanks for your suggestions, though.
Qu**********@HEREHotmail.com says...

I'm with Rick on this one. There are much better newsgroups to ask
about .NET topics, hence why I said in my reply "I use VB5", "This is
how VB4+5+6 work". It would have been much nicer to just take Rick's
reply and just ask the right people. Talking about a kill file will
get people's backs up, least of all mine. Those who start insulting
after being told a small point like Rick's means they know they're in
the wrong.

I, too, have been casually replying to people's questions and comments
for years, and I know that we very rarely get .NET questions, and
those we do we usually send them off to a newsgroup that can reply
properly. We do them a favour instead o them searching for yet more
newsgroups. Monitoring this newsgroup, for however long, will show
you how little .NET questions and answers we actually get, and
therefore some kind of bell should have rung in your head to point
you towards the newsgroups with the words "Visual" "Basic" AND "Net"
if you saw them. They have descriptive names for a reason. I hope
you find a newsgroup that can reply to your question, and rest
assured you won't be getting many people asking questions about .NET
products in this newsgroup, which means you don't have to keep
monitoring our group for them, let alone reply to anybody.

Jul 17 '05 #9

P: n/a
"Tony Vitonis" <no***@nowhere.com> wrote in message
news:MP************************@news.md.comcast.gi ganews.com
You're free to ask whatever questions you like, of course. As am I.
And if I'm told to bog off, then I'll just add another entry to my
kill file. Couldn't be simpler.


add me too; it won't be long before you are alone here and maybe then you'll
just find it easier to go to the right place rather than continuing to
bother people with off-topic posts.
Jul 17 '05 #10

P: n/a
On Wed, 15 Oct 2003 15:23:25 -0700, "Bob Butler" <ti*******@nospam.com>
wrote:
"Tony Vitonis" <no***@nowhere.com> wrote in message
news:MP************************@news.md.comcast.g iganews.com
You're free to ask whatever questions you like, of course. As am I.
And if I'm told to bog off, then I'll just add another entry to my
kill file. Couldn't be simpler.


add me too; it won't be long before you are alone here and maybe then you'll
just find it easier to go to the right place rather than continuing to
bother people with off-topic posts.


I'd like to be in your killfile too; in fact, I think all classic VB
posters should likewise volunteer...
Jul 17 '05 #11

P: n/a
On Wed, 15 Oct 2003 17:04:31 -0400, Tony Vitonis <no***@nowhere.com>
wrote:
You're free to ask whatever questions you like, of course. As am I.
And if I'm told to bog off, then I'll just add another entry to my
kill file. Couldn't be simpler.

Have a nice day! =c)


Looks like you're going to have a pretty big kill file
Jul 17 '05 #12

P: n/a
My question was about the Visual Basic language, posted to a group
called comp.lang.visual.basic. Your replies are the the bothersome
off-topic ones, though I understand that I'm contributing to that
here.

By the way, I'll add whom I like to my kill file. Thanks for the many
suggestions, though.

Have a nice day! =c)
Enigman O'Maly wrote:

I'd like to be in your killfile too; in fact, I think all classic
VB posters should likewise volunteer...
Bob Butler wrote:

add me too; it won't be long before you are alone here and maybe
then you'll just find it easier to go to the right place rather
than continuing to bother people with off-topic posts.
Tony Vitonis wrote:

You're free to ask whatever questions you like, of course. As am
I. And if I'm told to bog off, then I'll just add another entry
to my kill file. Couldn't be simpler.

Jul 17 '05 #13

P: n/a
"Tony Vitonis" <no***@nowhere.com> wrote in message
news:MP************************@news.md.comcast.gi ganews.com
My question was about the Visual Basic language,
No, it was VB.Net; they are not the same.
posted to a group
called comp.lang.visual.basic. Your replies are the the bothersome
off-topic ones, though I understand that I'm contributing to that
here.


Jul 17 '05 #14

P: n/a
> > My question was about the Visual Basic language,

No, it was VB.Net; they are not the same.
posted to a group
called comp.lang.visual.basic. Your replies are the the bothersome
off-topic ones, though I understand that I'm contributing to that
here.


He won't listen Bob... I tried patiently explaining that to him and, for my
efforts, he kill-filed me for "berating" him (his term, not mine). You
really gotta marvel over the arrogance of personalities like Tony. I wonder
if, when approaching a public rest room (loo?) with the words MEN and WOMEN
on the door, whether Tony feels free to enter either one since he sees the
word "MEN" on both doors.<g>

Rick
Jul 17 '05 #15

P: n/a
Since he has kill-filed you, good man, he won't see what see what you wrote.
So, as long as I don't mention it, or who it was in reply to, then he'll
have lost out on that keen observation. However, I agree wholeheartedly.

--
QuickHare
(Qu**********@HEREHotmail.com)
Remove the NOT and HERE to E-Mail direct.
Enleve les NOT et HERE E-Mail moi directement.

PS. VB.NET is called VB.net and not VISUALBASIC.net for a reason, and it is
never refered to as "Visual Basic [dot] Net". The reason is that the two are
completely different and this newsgroup deals with VISUAL BASIC, not VB.NET.

Jul 17 '05 #16

P: n/a
On Fri, 17 Oct 2003 19:57:22 +0100, "QuickHare"
<Qu**********@HEREHotmail.com> wrote:
PS. VB.NET is called VB.net and not VISUALBASIC.net for a reason, and it is
never refered to as "Visual Basic [dot] Net". The reason is that the two are
completely different and this newsgroup deals with VISUAL BASIC, not VB.NET.


Which is also why it's usually called "Visual Fred"...

Perhaps in this case it should be called "Visual Tony"...
Jul 17 '05 #17

P: n/a
"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:X7********************@comcast.com
<cut>
He won't listen Bob... I tried patiently explaining that to him and,
for my efforts, he kill-filed me for "berating" him (his term, not
mine). You really gotta marvel over the arrogance of personalities
like Tony.
At this stage of my life I no longer marvel over them; it's just not worth
the aggravation.
I wonder if, when approaching a public rest room (loo?)
with the words MEN and WOMEN on the door, whether Tony feels free to
enter either one since he sees the word "MEN" on both doors.<g>


LOL; that has to be the best analogy I've seen yet!

Jul 17 '05 #18

This discussion thread is closed

Replies have been disabled for this discussion.