Running App in design environment is very slow

Y

Young

Hi,

I am converting a VB6 app. to VB.Net.

When I run the app. in the IDE, it is very very slow. If I compiled it, the
speed is acceptable but still slower than the equivalent VB6 app.

Can someone please tell me if there's any compile settings/options that will
make the app. run faster in the IDE as well as the compiled version? I've
already set it to compile "optimisation".

TIA
Young
 
P

PvdG42

Young said:
Hi,

I am converting a VB6 app. to VB.Net.

When I run the app. in the IDE, it is very very slow. If I compiled it,
the speed is acceptable but still slower than the equivalent VB6 app.

Can someone please tell me if there's any compile settings/options that
will make the app. run faster in the IDE as well as the compiled version?
I've already set it to compile "optimisation".

TIA
Young
Before we can address your issue, it would be helpful if you could describe
exactly what you mean by "I am converting...".
Are you redesigning/rewriting the code to do things "the .NET" way, or did
you accept conversion wizard output and make minimal code changes as
required by wizard instructions? I'm not trying to say this is the only
issue, but if you did the latter, the results will be less efficient.
 
N

Nobody

Young said:
Hi,

I am converting a VB6 app. to VB.Net.

When I run the app. in the IDE, it is very very slow. If I compiled it,
the speed is acceptable but still slower than the equivalent VB6 app.

Can someone please tell me if there's any compile settings/options that
will make the app. run faster in the IDE as well as the compiled version?
I've already set it to compile "optimisation".

How much memory do you have in your system?

Try using Ngen tool:

http://en.wikipedia.org/wiki/Common_Intermediate_Language#Native_image_generator_compilation

Native Image Generator (Ngen.exe)
http://msdn.microsoft.com/en-us/library/6t9t5wcf(VS.80).aspx
 
Y

Young

Hi,

I am doing the conversion manually.

Young

PvdG42 said:
Before we can address your issue, it would be helpful if you could
describe exactly what you mean by "I am converting...".
Are you redesigning/rewriting the code to do things "the .NET" way, or did
you accept conversion wizard output and make minimal code changes as
required by wizard instructions? I'm not trying to say this is the only
issue, but if you did the latter, the results will be less efficient.
 
C

Cor Ligthert[MVP]

Young,

This is in fact not of interest to ask in all those newsgroups you are cross
posting to.
This is typical language VB, therefore please cut of those newsgroups which
are not language.vb the next time.
I don't do that now to show others that I have asked this already to you.

Now your answer,

Running VB for Net is normally as fast as any (large) C++ or C# language.

However, to make conversion from VB to VB6 possible, it was needed to keep
the same behaviour as in VB6 (which is obviously slower then C++).
This behaviour is late (Type) binding (resolve types at runtime instead of
design time), think about the Var in VB6 to get an idea about this.

The simple trick is to set Option Strict to On in top of your programs or
easier in the Options (However, in fact is in top better because the Options
are an IDE part).

As you are using version 2008 and set then direct Option Infer to On, then
you get back a little bit of the VB6 behaviour but then with early (Type)
binding, but this only inside a method. This I write because because do you
have less to change (and this late sentence for the puritans).

It is easier for you to set it every time in top of a class (form whatever
you probably still call it), because then you can do it class by class.

The most problems you will encounter will be solved by this statement
"CType(TheVariable,TheType)" you see mostly the type in the error message
which shows up. (It is better to use Directcast instead CType in some
situations, but the result of that is so low that it is not important while
being busy with conversion).

I hope this helps a little bit,

Cor
 

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