473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Inlining?

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
17 2329
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
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
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
> 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
> > 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
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
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
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
"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
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
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
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
"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
> > 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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: glen_stark | last post by:
Hi. I'm just curious if there any warnings or caveats or whatever to be aware of when inlining function object calls? If the answer is no, they inline just like everything else, that's good...
10
by: gianguz | last post by:
The question is about the possible use of inlining to improve performance in a heavy multithreading environment (200+ threads). If we have to work with applications in which threads aren't I/O...
5
by: Raphael | last post by:
Hello, I have 2 files A.c : Defining a bunch of usefull functions B.c : Defining a main that uses these ones. I need to improve perfs : I know that, if the caller and the functions called...
11
by: Elpoca | last post by:
Hi: What rules govern the inlining of templated functions and templated class methods? It has always been my understanding that both templated functions and templated class methods were...
21
by: LuB | last post by:
How judicious ought one be when inlining small methods. I once read that in general, most compiles will only inline 'one' level. IE: if all the following methods were declared/defined as...
15
by: Lloyd Dupont | last post by:
I have some code which looks like that: public CornerStyle RectCornerMode { get { return this.GetValue<CornerStyle>(); } set { this.SetValue<CornerStyle>(value); } }
21
by: Michael Hull | last post by:
Hi, I remember from somewhere reading that inlining constructors is a 'BadThing', but now can't seem to find the original source. I can't however thing of a reason why it would be for simple...
8
by: Yakov | last post by:
I'd like a tool that performed inlining of function bodies of which do not appear in the .h file. Really. gcc on Linux. Yakov
58
by: sh.vipin | last post by:
is there any way to find out number of bytes freed on a particular free() call in C
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.