none
Coverted applicaition running very slow in DEBUG, VS 2012 VB RRS feed

  • Question

  • I am converting several programs from VB6 to VS 2008 and then to VS2012.  So far all have converted with a few issues, but nothing I have not been able to address, until now.  The last application I converted runs in 10 to 15 seconds under VB6 but takes 5 or more minutes to run in VS 2012.  I have done extensive searches on the web and tried everything I have found, but nothing seems to help.  Any suggestions would be greatly appreciated.
    Wednesday, September 11, 2013 5:05 PM

Answers

  • Do you mean compiling takes long, or from the start of the process until you see the first form? What if you start the compiled Exe or if you "start without debugging" (Ctrl+F5)?

    Is the CPU busy all the time?

    Do you see any progress during that 5 minute or does it just hang?

    I'd start Process Explorer to examine the process. Look on the "threads" tab if there's anything suspicious.

    Just guessing: Try disconnecting from the network or internet before.


    Armin


    Wednesday, September 11, 2013 5:16 PM

All replies

  • Do you mean compiling takes long, or from the start of the process until you see the first form? What if you start the compiled Exe or if you "start without debugging" (Ctrl+F5)?

    Is the CPU busy all the time?

    Do you see any progress during that 5 minute or does it just hang?

    I'd start Process Explorer to examine the process. Look on the "threads" tab if there's anything suspicious.

    Just guessing: Try disconnecting from the network or internet before.


    Armin


    Wednesday, September 11, 2013 5:16 PM
  • First look what errors you get more with Option Strict On, and to reduce them than again set Option Infer On too. 

    The first creates with Off late binding and the second solves that again by inferring the code like a spell checker and set the early binding if there only can be one solution. 

    dim a = "text" means that a is always a string so the compiler set that for you.


    Success
    Cor

    Wednesday, September 11, 2013 5:18 PM
  • A simple way to find what is slowing your code is to repeatedly pause and then resume and then pause your application while it's running in the debugger.  The lines it stops on are most likely the ones executing slowly.  If you resume and pause again and it's still on the same line, that line is very likely to be a source of slow execution.  That gives you a starting point to work with.  Post the slow code here and we can try to help make it more efficient.


    Ray

    Wednesday, September 11, 2013 6:04 PM
  • Yes, there is something looping or whatever behavior you just have to find it. Put in a timer, not the timer object I mean save the time at the start of a subroutine and at the end show the elapsed time in that sub in vb6 and 2012 versions see if you can spot where it occurs. Run the compiled versions not in the debugger look for ide issues. Watch the declares as others have said you may have an integer becoming some object because of a name change etc especially things passed from one routine to another. Start removing code until you hit on it, one sub or even one line at a time (ie comment it out, put a goto around it etc).
    Wednesday, September 11, 2013 7:06 PM
  • I think it's still not clear whether starting the application is slow, so it's pure speculation. Optimizing code is then maybe not required.

    Armin

    Wednesday, September 11, 2013 7:16 PM
  • Use a profiler.  There are a number of free ones available or you can get a trial version of Red-Gate Ants profiler.  It will tell you where the bottlenecks are.
    Wednesday, September 11, 2013 7:18 PM
  • I think it's still not clear whether starting the application is slow, so it's pure speculation. Optimizing code is then maybe not required.

    Armin

    Maybe you don't agree with me that setting Option Strict On can result in better running code, but I've fine results with that.

    If you could see my face now.


    Success
    Cor


    • Edited by Cor Ligthert Wednesday, September 11, 2013 7:56 PM
    Wednesday, September 11, 2013 7:56 PM
  • Maybe you don't agree with me that setting Option Strict On can result in better running code, but I've fine results with that.

    If you could see my face now.


    hahaha  :-D

    Hi Cor,

    some days ago, I thought you've left the building, after getting the 1 Mio € award for your 100,000 points. ;-) But then you came back from vacation obviously. Nice to meet you again. :-)

    What do you think about "takes 5 or more minutes to run in VS 2012"? Compiling? Attaching a debugger? Let's wait what the OP says...


    Armin

    Wednesday, September 11, 2013 8:19 PM