speed issues

M

Mike Williams

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
 
B

Bill McCarthy

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

Mike Williams

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
 
B

Bill McCarthy

Mike Williams said:
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.discussion, 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 ? ;)
 
M

Mike Williams

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
 
B

Bill McCarthy

Mike Williams said:
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.
 
T

Tom Shelton

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

AMercer

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

Mike Williams

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
 
M

Mike Williams

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
 
T

Tom Shelton

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

Brian Gideon

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

Brian Gideon

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

Tom Shelton

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

Bill McCarthy

Mike Williams said:
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.

Oh Mike, you're still trolling here. If you read what I said, was that I
expect VB.NET and Vb6 to be the same. You're trying to put words in my
mouth I never said. What I did say was your deliberate misquoting of
someone else, only reporting half the story is misleading.
 
G

Galen Somerville

AMercer said:
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
 
T

Tom Shelton

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

Are you using COM interop for this? My guess is yes, because there are
definately issues with that - especially if your making lots of calls.
 
B

Bill McCarthy

Galen Somerville said:
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.

What do you mean by directly ? It is a COM based dll ?

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

Sure there can be some, and there is also marshalling in VB6 as well, just
you don't see it. What format is the data in ?
 
T

Tom Shelton

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

By the way, have you considered using a .NET based USB library? I
haven't tested it or used it, but over at icsharpcode.net there is a
#usblib :)
 
M

Mike Williams

If you read what I said, was that I expect VB.NET
and Vb6 to be the same. You're trying to put words
in my mouth I never said.

No I'm not. I suggested that the statement made by Cor Ligthert on 22 April
was at best intentionally misleading and at worst deliberately inflammatory
when he said about vb.net code [comparing it to VB6 code]:

"When well done it can be about 10 times quicker"
"When bad done it can be about 10 times slower."

Ligthert was deliberately trying to suggest that a well coded vb.net program
would run ten times faster than a similar VB6 program, which is definitely
NOT the case. Both programs would in fact run at approximately the same
speed, with perhaps the odd difference here and there and Ligthert's
statement was a deliberate attempt to pretend that vb.net is faster than
VB6, which it is NOT. Any programming language can run ten times slower than
any other programming langauge if the code is badly written, whatever those
languages are, so that statement conveys no useful information at all. But
the statement that well done vb.net can be about ten times quicker than VB6
is clearly intended to persuade people that a well done vb.net program is
ten times quicker than a well done VB6 program (otherwise the comparision
has no validity at all). Therefore Ligthert was deliberately trying to be
provovative and was effectively telling lies.You told me that his statement
was /not/ misleading, when in fact it very clearly was, as is evidenced by
the fact that other people here on this vb.net group have since told me that
virtually the exact same statement, but with VB6 and vb.net reversed, was
deliberately misleading and was probably written by someone with "an axe to
grind".

You did later make a statement that in your view both programs would run at
about the same speed, but you made that statement simply because you were
attempting to defend your failure to condemn Ligthert's deliberately
inflammatory statement while at the same time you spend half of your life
spamming and trolling the VB6 newsgroup and jumping on anybody who makes
even the slightest remark about vb.net.

You are trolling the VB6 group and you are upsetting a lot of people. I
suggest that if you prefer vb.net that you stay in the vb.net group and that
you stop deliberately spamming and trolling the VB6 group. Stay away from
your trolling of the VB6 group and we will not follow you here! You are a
spammer and a troll.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top