speed issues

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike Williams

    speed issues

    I'm trying to decide whether or not I need to move to a different
    development tool and I'm told that VB6 code, when well written, can be ten
    times faster than vb.net, but that if its badly written it can be ten times
    slower. Is that correct?

    I'm quite competent at writing code myself and so most of my code will be
    quite well written, and I don't want to move to vb.net if well written VB6
    code is ten times faster. Have I been told the truth? Or do I need to look
    into this further?

    Mike


  • Bill McCarthy

    #2
    Re: speed issues

    Hi Mike,

    Great to see you considering VB.NET. Optimized code in VB.NEt will run
    much a muchness with optimized code in VB6. The questions are how hard is
    that to write and maintain and do you need extra functionality. These are
    the reasons you should be looking at .NET.
    Note: simple apps (single tier, few components) will have a larger startup
    hit in .NET compared to VB6, but once past that initial load the .NET apps
    typically allocate objects more efficiently. A typical example is a long
    running server app, where .NET GC management makes it very robust and
    scalable.
    One other reason you might want to consider .NET is for 64 bit applications.

    But as to actual speed, well when all is said and done, for simple
    operations they both eventually become X86 operations. I have written VB6
    apps that have been faster than C++ apps, that was until they let me fix
    the C++ code ;) If you have performance critical code, you can do it in
    equally in VB6 or .NET.


    "Mike Williams" <mikea@whiskyan dCoke.comwrote in message
    news:euceFvipIH A.4848@TK2MSFTN GP05.phx.gbl...
    I'm trying to decide whether or not I need to move to a different
    development tool and I'm told that VB6 code, when well written, can be ten
    times faster than vb.net, but that if its badly written it can be ten
    times slower. Is that correct?
    >
    I'm quite competent at writing code myself and so most of my code will be
    quite well written, and I don't want to move to vb.net if well written VB6
    code is ten times faster. Have I been told the truth? Or do I need to look
    into this further?
    >
    Mike
    >
    >

    Comment

    • Mike Williams

      #3
      Re: speed issues

      "Bill McCarthy" <Bill@N0SPAM.co mwrote in message
      news:412CEBF0-9499-4516-8384-1736739DA3F6@mi crosoft.com...
      Hi Mike, Great to see you considering VB.NET. Optimized
      code in VB.NEt will run much a muchness with optimized
      code in VB6.
      Okay. Thanks Bill. So would you say that the statement "well written VB6
      code can run ten times faster than vb.net" to be a perfectly valid
      statement, or would you consider it to be misleading?

      It's just that I've been definitely told that by someone who reckons he
      knows about these things and who has written programs in both tools and I'm
      wondering if he is making a deliberately misleading statement? What do you
      think? And what do others here think about it? Am I being misled?

      Mike



      Comment

      • Bill McCarthy

        #4
        Re: speed issues


        "Mike Williams" <mikea@whiskyan dCoke.comwrote in message
        news:eGG6Y9ipIH A.4888@TK2MSFTN GP04.phx.gbl...
        "Bill McCarthy" <Bill@N0SPAM.co mwrote in message
        news:412CEBF0-9499-4516-8384-1736739DA3F6@mi crosoft.com...
        >
        >Hi Mike, Great to see you considering VB.NET. Optimized
        >code in VB.NEt will run much a muchness with optimized
        >code in VB6.
        >
        Okay. Thanks Bill. So would you say that the statement "well written VB6
        code can run ten times faster than vb.net" to be a perfectly valid
        statement,
        Well written code in either VB6 or .NET can run ten times faster than badly
        written code. Both offer vast areas for performance tweaking.
        There's probably corners of either of them where you can tweak things in
        extremes.
        or would you consider it to be misleading?
        I would call it misleading if someone was to report only half the story or
        statements. Such as if someone said Well written code can run ten times
        faster and badly written code can run ten times slower, then if someone was
        to only report half that statement, then yes that would be misleading.
        It's just that I've been definitely told that by someone who reckons he
        knows about these things and who has written programs in both tools and
        I'm wondering if he is making a deliberately misleading statement?
        Really ? Sure you didn't cut what they said in half ? If I read your post
        in vb.general.disc ussion, it seems you did. Seems to me perhaps you are
        just trying to be mischievous here, no ?
        >
        What do you think? And what do others here think about it? Am I being
        misled?
        >
        Or are you being misleading ? ;)











        Comment

        • Mike Williams

          #5
          Re: speed issues

          "Bill McCarthy" <Bill@N0SPAM.co mwrote in message
          news:80D67E04-94CC-4FEA-8BE3-5B7D2E5A7B35@mi crosoft.com...
          I would call it misleading if someone was to report
          only half the story or statements. Such as if someone
          said Well written code can run ten times faster and
          badly written code can run ten times slower, then if
          someone was to only report half that statement, then
          yes that would be misleading.
          Right. Thanks. Can I take it then that you consider the statement "Well
          written VB6 code can be ten times faster than vb.net code", but badly
          written VB6 code can be ten times slower" to be a perfectly valid statement,
          and the person who stated it was almost certainly not trying to mislead me?

          You'll notice that the person did /not/ say well written VB6 code can be ten
          times faster than badly written vb.net code. He said "well written VB6 code
          can be ten times faster than vb.net code", without specifying whether the
          vb.net code he was comparing or to was well or was badly written. It seemed
          to me that he was comparing well written VB6 code with vb.net code in
          general, and that to produce code in VB6 which was slower than vb.net you
          would have to deliberately write it badly.

          So you can see how confused that statement has left me. It's just that I
          need to be sure about these things before I decide whether to make the move
          or not. I don't want to end up using a tool (vb.net) that produces code
          which is ten times slower than well written VB6 code. But you have told me
          that telling that I wasn't being misled by that statement, so I'm assuming
          that I've got to be very careful here.

          The man says he has used both tools and that he currently uses VB6 and that
          he was telling me nothing but the truth, but others have told me that his
          statement was misleading, and quite probably deliberately so. At the moment,
          in view of what I have been told about well written VB6 code being ten times
          faster than vb.net code (without specifying whether the vb.net code it is
          being compared to was well or badly written), it appears that I might be
          making a bad decision if I were to move to vb.net.

          Is there anyone here who has used both VB6 and vb.net and who can tell me
          whether I am safe to move, or is the statement I was given misleading?

          Thanks for you responses so far.

          Mike



          Comment

          • Bill McCarthy

            #6
            Re: speed issues


            "Mike Williams" <mikea@whiskyan dCoke.comwrote in message
            news:e1PjUSjpIH A.5916@TK2MSFTN GP04.phx.gbl...
            >
            So you can see how confused that statement has left me.
            No I can't. It looks to me like you are deliberately trying to twist a
            statement. If someone says to me code can run ten times faster or ten times
            slower, then I take that as meaning much of a muchness. But in your
            statements, you quoted only the ten times faster which gives it a completely
            different meaning.

            Comment

            • Tom Shelton

              #7
              Re: speed issues

              On 2008-04-24, Mike Williams <mikea@whiskyan dCoke.comwrote:
              I'm trying to decide whether or not I need to move to a different
              development tool and I'm told that VB6 code, when well written, can be ten
              times faster than vb.net, but that if its badly written it can be ten times
              slower. Is that correct?
              >
              I'm quite competent at writing code myself and so most of my code will be
              quite well written, and I don't want to move to vb.net if well written VB6
              code is ten times faster. Have I been told the truth? Or do I need to look
              into this further?
              >
              Mike

              Mike, good to see you over here! Of course, I don't believe for a
              second that you have any real intention of moving anything to .NET :)
              But, let me take a stab at replying to your concerns over speed...

              First, I believe, that on average - given equal quality code bases,
              VB6 code is going to have slight (no way do I buy into a factor of 10),
              speed advantage.

              That being said - there are other factors to consider that may outweigh
              whatever small speed gain you may get by using VB6 over VB.NET. Isn't
              it true, that for some kinds of applications that C++ is faster the VB6?
              Yet, you chose VB6 over C++ as your language of choice? Why? You
              couldn't have based that decision purely on the speed of execution, or
              you would be writing all your code in hand optimized assembly....

              That is not to imply that speed is not a factor in choosing a
              development environment - of course it is, but there is a balance
              between speed and developer productivity.

              --
              Tom Shelton

              Comment

              • =?Utf-8?B?QU1lcmNlcg==?=

                #8
                Re: speed issues

                Is there anyone here who has used both VB6 and vb.net and who can tell me
                whether I am safe to move, or is the statement I was given misleading?
                It is 'safe to move'. Some things you do will run slower than you think
                they should, and with experience, you will overcome these problems. A
                profiler is a big time saver. The statement was misleading, and it sounds
                like the speaker is not spun up on .net or maybe he has an ax to grind. I
                think vb.net programs perform just fine.

                Comment

                • Mike Williams

                  #9
                  Re: speed issues

                  "Tom Shelton" <tom_shelton@YO UKNOWTHEDRILLco mcast.netwrote in message
                  news:OS19Z7jpIH A.2256@TK2MSFTN GP05.phx.gbl...
                  First, I believe, that on average - given equal quality code
                  bases, VB6 code is going to have slight (no way do I buy
                  into a factor of 10), speed advantage.
                  So may I take it that you think the statement, "well written VB6 code can be
                  ten times faster than vb.net" is a misleading statement?

                  Mike



                  Comment

                  • Mike Williams

                    #10
                    Re: speed issues

                    "AMercer" <AMercer@discus sions.microsoft .comwrote in message
                    news:58D64022-4AB9-470D-97B5-C17A3CAA17D3@mi crosoft.com...
                    It is 'safe to move'. Some things you do will run slower than
                    you think they should, and with experience, you will overcome
                    these problems. A profiler is a big time saver. The statement
                    was misleading, and it sounds like the speaker is not spun up
                    on .net or maybe he has an ax to grind.
                    Thank you. In fact that's what I thought myself. The problem is that Bill
                    McCarthy told me that such a statement was perfectly valid and that he does
                    not believe it is in any way misleading and, knowing that McCarthy is a
                    regular contributor here, I actually believed him. Thanks for pointing out
                    your belief that the statement is actually misleading. At least I know now
                    that I can safely make the move and that Bill McCarthy is wrong. Thank you.

                    Mike



                    Comment

                    • Tom Shelton

                      #11
                      Re: speed issues

                      On 2008-04-24, Mike Williams <mikea@whiskyan dCoke.comwrote:
                      "Tom Shelton" <tom_shelton@YO UKNOWTHEDRILLco mcast.netwrote in message
                      news:OS19Z7jpIH A.2256@TK2MSFTN GP05.phx.gbl...
                      >
                      >First, I believe, that on average - given equal quality code
                      >bases, VB6 code is going to have slight (no way do I buy
                      >into a factor of 10), speed advantage.
                      >
                      So may I take it that you think the statement, "well written VB6 code can be
                      ten times faster than vb.net" is a misleading statement?
                      On average yes - I would say that is a misleading statement. There may
                      be some corner cases where this statement maybe true, but overall - it's
                      false.

                      --
                      Tom Shelton

                      Comment

                      • Brian Gideon

                        #12
                        Re: speed issues

                        On Apr 24, 11:53 am, "Mike Williams" <mi...@whiskyan dCoke.comwrote:
                        I'm trying to decide whether or not I need to move to a different
                        development tool and I'm told that VB6 code, when well written, can be ten
                        times faster than vb.net, but that if its badly written it can be ten times
                        slower. Is that correct?
                        >
                        I'm quite competent at writing code myself and so most of my code will be
                        quite well written, and I don't want to move to vb.net if well written VB6
                        code is ten times faster. Have I been told the truth? Or do I need to look
                        into this further?
                        >
                        Mike
                        Hi Mike. I'm having a hard time buying that. In fact, I would have
                        thought the opposite, except not by a factor of 10. One advantage of
                        VB.NET over VB6 is the JIT compiler which can optimize the code for a
                        specific processor. That's one concrete example of how VB.NET "could"
                        be faster than VB6. I'll have to do some tests to see what scenarios
                        perform better in each language.

                        It sounds like you're already aware of this, but the main thing that
                        effects performance is the programmer. For example, there's no
                        language or CPU architecture that's going to keep up with a O(n^2)
                        algorithm when a O(n*log(n)) can do the same job. A skilled
                        programmer can make a VB6 program run circles around an unskilled
                        programers C++ equivalent.

                        Comment

                        • Brian Gideon

                          #13
                          Re: speed issues

                          On Apr 24, 3:18 pm, "Mike Williams" <mi...@whiskyan dCoke.comwrote:
                          "Tom Shelton" <tom_shel...@YO UKNOWTHEDRILLco mcast.netwrote in message
                          >
                          news:OS19Z7jpIH A.2256@TK2MSFTN GP05.phx.gbl...
                          >
                          First, I believe, that on average - given equal quality code
                          bases, VB6 code is going to have slight (no way do I buy
                          into a factor of 10), speed advantage.
                          >
                          So may I take it that you think the statement, "well written VB6 code can be
                          ten times faster than vb.net" is a misleading statement?
                          >
                          Mike
                          I think it is misleading as well.

                          Comment

                          • Tom Shelton

                            #14
                            Re: speed issues

                            On 2008-04-24, Brian Gideon <briangideon@ya hoo.comwrote:
                            On Apr 24, 11:53 am, "Mike Williams" <mi...@whiskyan dCoke.comwrote:
                            >I'm trying to decide whether or not I need to move to a different
                            >development tool and I'm told that VB6 code, when well written, can be ten
                            >times faster than vb.net, but that if its badly written it can be ten times
                            >slower. Is that correct?
                            >>
                            >I'm quite competent at writing code myself and so most of my code will be
                            >quite well written, and I don't want to move to vb.net if well written VB6
                            >code is ten times faster. Have I been told the truth? Or do I need to look
                            >into this further?
                            >>
                            >Mike
                            >
                            Hi Mike. I'm having a hard time buying that. In fact, I would have
                            thought the opposite, except not by a factor of 10. One advantage of
                            VB.NET over VB6 is the JIT compiler which can optimize the code for a
                            specific processor. That's one concrete example of how VB.NET "could"
                            be faster than VB6. I'll have to do some tests to see what scenarios
                            perform better in each language.
                            >
                            While the JIT compiler does present an area of potential benifit on the
                            ..NET side - there are runtime checks that offset this at least somewhat.
                            The runtime security involves walking the stack to make sure that any calls
                            (such as API calls, etc) are valid in the current security context.
                            This imposes some overhead.

                            Of course, moving forward into 64-bit land - the .NET app may have a
                            considerable advantage over a VB6 app. Also, with multi-core processors
                            becoming the norm, it's easier to take advantage of this with a .NET app.
                            It sounds like you're already aware of this, but the main thing that
                            effects performance is the programmer. For example, there's no
                            language or CPU architecture that's going to keep up with a O(n^2)
                            algorithm when a O(n*log(n)) can do the same job. A skilled
                            programmer can make a VB6 program run circles around an unskilled
                            programers C++ equivalent.
                            And this is defintaely true.
                            --
                            Tom Shelton

                            Comment

                            • Galen Somerville

                              #15
                              Re: speed issues


                              "AMercer" <AMercer@discus sions.microsoft .comwrote in message
                              news:58D64022-4AB9-470D-97B5-C17A3CAA17D3@mi crosoft.com...
                              >Is there anyone here who has used both VB6 and vb.net and who can tell me
                              >whether I am safe to move, or is the statement I was given misleading?
                              >
                              It is 'safe to move'. Some things you do will run slower than you think
                              they should, and with experience, you will overcome these problems. A
                              profiler is a big time saver. The statement was misleading, and it sounds
                              like the speaker is not spun up on .net or maybe he has an ax to grind. I
                              think vb.net programs perform just fine.
                              >
                              In my personal opinion, marshaling is the speed killer in vb.net.

                              I have a vb6 app that gets short burst's of data, repeatedly, from a USB
                              device. Normally a USB device is used to get large chunks of data.

                              In vb6 the USB dll is called directly.

                              I have stepped through the net code and it goes all over the place before it
                              actually gets to the USB dll.

                              Galen


                              Comment

                              Working...