Inlining?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony Vitonis

    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.


  • QuickHare

    #2
    Re: Inlining?

    I use VB5, so this answer may be open to debate. This is how VB4+5+6 work:[color=blue]
    > 1. Does the VB compiler sometimes inline simple functions?[/color]
    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.
    [color=blue]
    > 2. Is there much of a performance hit on a function call?[/color]
    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
    (QuickHareNOT@H EREHotmail.com)
    Remove the NOT and HERE to E-Mail direct.
    Enleve les NOT et HERE รก E-Mail moi directement.


    Comment

    • Rick Rothstein

      #3
      Re: Inlining?

      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.discu ssion
      vb.dotnet.techn ical

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

      microsoft.publi c.dotnet.genera l
      microsoft.publi c.dotnet.langua ges.vb

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

      Rick - MVP




      "Tony Vitonis" <noone@nowhere. com> wrote in message
      news:jxOdnfg0rb 2zSBeiU-KYjA@comcast.co m...[color=blue]
      > 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.
      >
      >[/color]


      Comment

      • Tony Vitonis

        #4
        Re: Inlining?

        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*
        [color=blue]
        > rickNOSPAMnews@ NOSPAMcomcast.n et 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.discu ssion
        > vb.dotnet.techn ical
        >
        > For the microsoft news server, try these newsgroups...
        >
        > microsoft.publi c.dotnet.genera l
        > microsoft.publi c.dotnet.langua ges.vb
        >
        > There are some others, but these should get you started.
        >[color=green]
        >> 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.[/color][/color]

        Comment

        • Rick Rothstein

          #5
          Re: Inlining?

          > 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

          [color=blue]
          > and I've already found somebody to put in my kill file.[/color]

          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.

          [color=blue]
          > Best of luck in your VB.NET policing endeavor, Rick.[/color]

          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).

          [color=blue]
          > I for one intend to continue asking such questions[/color]

          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.star ted 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.

          [color=blue]
          > and to continue responding to them when other people ask them.[/color]

          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


          Comment

          • QuickHare

            #6
            Re: Inlining?

            > > Wow. Only three days monitoring the newsgroup[color=blue]
            >
            > "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[/color]
            watched[color=blue]
            > 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[/color]
            at[color=blue]
            > 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[/color]
            those[color=blue]
            > for which it was originally created. Congratulations on your marvelous
            > powers of insight; you should apply for a job at Microsoft... they[/color]
            obviously[color=blue]
            > could use someone as gifted as you to fill in
            >[/color]
            <SNIP>[color=blue][color=green]
            > > and to continue responding to them when other people ask them.[/color]
            >
            > 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[/color]
            then[color=blue]
            > is suggest they ask additional questions in the newsgroups created[/color]
            specially[color=blue]
            > 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[/color]
            question,[color=blue]
            > so that these individuals will know of a location better able to handle
            > their questions.[/color]

            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
            (QuickHareNOT@H EREHotmail.com)
            Remove the NOT and HERE to E-Mail direct.
            Enleve les NOT et HERE รก E-Mail moi directement.


            Comment

            • J French

              #7
              Re: Inlining?

              On Tue, 14 Oct 2003 10:32:03 -0400, Tony Vitonis <noone@nowhere. com>
              wrote:
              [color=blue]
              >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*[/color]

              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

              Comment

              • Tony Vitonis

                #8
                Re: Inlining?

                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)
                [color=blue]
                > erewhon@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
                >[color=green]
                >> 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*[/color][/color]

                Comment

                • Tony Vitonis

                  #9
                  Re: Inlining?

                  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.
                  [color=blue]
                  > QuickHareNOT@HE REHotmail.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.[/color]

                  Comment

                  • Bob Butler

                    #10
                    Re: Inlining?

                    "Tony Vitonis" <noone@nowhere. com> wrote in message
                    news:MPG.19f780 6ab600b73d98968 2@news.md.comca st.giganews.com[color=blue]
                    > 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.[/color]

                    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.


                    Comment

                    • Enigman O'Maly

                      #11
                      Re: Inlining?

                      On Wed, 15 Oct 2003 15:23:25 -0700, "Bob Butler" <tiredofit@nosp am.com>
                      wrote:
                      [color=blue]
                      >"Tony Vitonis" <noone@nowhere. com> wrote in message
                      >news:MPG.19f78 06ab600b73d9896 82@news.md.comc ast.giganews.co m[color=green]
                      >> 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.[/color]
                      >
                      >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.
                      >[/color]

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

                      Comment

                      • J French

                        #12
                        Re: Inlining?

                        On Wed, 15 Oct 2003 17:04:31 -0400, Tony Vitonis <noone@nowhere. com>
                        wrote:
                        [color=blue]
                        >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)[/color]

                        Looks like you're going to have a pretty big kill file

                        Comment

                        • Tony Vitonis

                          #13
                          Re: Inlining?

                          My question was about the Visual Basic language, posted to a group
                          called comp.lang.visua l.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)
                          [color=blue]
                          > Enigman O'Maly wrote:
                          >
                          > I'd like to be in your killfile too; in fact, I think all classic
                          > VB posters should likewise volunteer...
                          >[color=green]
                          >> 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.
                          >>[color=darkred]
                          >>> 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.[/color][/color][/color]

                          Comment

                          • Bob Butler

                            #14
                            Re: Inlining?

                            "Tony Vitonis" <noone@nowhere. com> wrote in message
                            news:MPG.19f882 f367bdab8698968 4@news.md.comca st.giganews.com[color=blue]
                            > My question was about the Visual Basic language,[/color]

                            No, it was VB.Net; they are not the same.
                            [color=blue]
                            > posted to a group
                            > called comp.lang.visua l.basic. Your replies are the the bothersome
                            > off-topic ones, though I understand that I'm contributing to that
                            > here.[/color]

                            Comment

                            • Rick Rothstein

                              #15
                              Re: Inlining?

                              > > My question was about the Visual Basic language,[color=blue]
                              >
                              > No, it was VB.Net; they are not the same.
                              >[color=green]
                              > > posted to a group
                              > > called comp.lang.visua l.basic. Your replies are the the bothersome
                              > > off-topic ones, though I understand that I'm contributing to that
                              > > here.[/color][/color]

                              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


                              Comment

                              Working...