none
Startup Delay for windows application RRS feed

  • Question

  • Hi,

    I have a windows application that I set its build options to optimize code in visual studio before creating a setup project for it. After installing it on my laptop, I noticed that it is taking some time to start (like a couple of seconds) when I double click on the desktop shorcut. Once it starts, it runs fast with no problems.

    I do not have any kind of processing taking place on startup, so I wonder is that a normal behavior for a windows application? Is there anything I should do for it, because the client is complaining about this? I am using .net 4.0 and visual studio 2010.

    Please advise...   Many thanks in advance.

    Thursday, May 19, 2011 11:14 PM

All replies

  •  

    Hi,

     

    Have you tried to disable /optimize code option to test whether the performance issue is caused by this option?

     

    As far as I know, the /optimize option enables or disables optimizations performed by the compiler to make your output file smaller, faster, and more efficient. Once you turn on the optimizations, the compiler applies many different techniques to make the code running faster while still doing the same. The most obvious difference between optimized and unoptimized builds in Visual C++ is the fact the variable values are kept in registers as long as possible in optimized builds, while without optimizations they are always stored into the memory. This affects not only the code speed, but it also affects debugging. As a result of this optimization the debugger cannot reliably obtain a variable value as you are stepping through the code.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Saturday, May 21, 2011 4:23 AM
  • There are some profiling tools, you can use these tools to measure the performance bottleneck to know why the startup is slow. VS professional and  higher edition supply this profiling feature. If you have the right edition, measure your app first.
    Best regards,
    Riquel

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Saturday, May 21, 2011 7:51 AM
  • code seems okay. I just need to create an animation while the application is loading (compiling) which would in turn increase the user's percieved speed of the application.

    Any links or help on this?

    Monday, May 23, 2011 7:34 AM
  • Can you try installing in another machine and check the startup time ?
    Monday, May 23, 2011 10:27 AM
  • I did. same results.
    Monday, May 23, 2011 11:10 AM
  • Hi,

     

    Could you please examine what exactly cause the problem?

    1.       Disable /optimize code option and run the application.

    This step is used to examine whether the issue is caused by /optimize code option.

    2.       Do not install the Setup.exe, just run the built application to examine whether the performance issue exists.

               Do this step to check whether the issue is caused by Setup project.

    3.    What is the application used to do? Will it load any complex components or user controls?

    After finding out what causes this issue, we can help to suggest ways to resolve the problem.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Edited by Paul Zhou Wednesday, May 25, 2011 2:08 AM
    Tuesday, May 24, 2011 7:27 AM
  • "I am using .net 4.0 and visual studio 2010." implies managed code? If you're using C# then there's the JIT time etc etc.  If you said what language you're using I must have missed it. 

    What optimizations are you using, and what evidence do you have that they sholud help ? Because apparently they may not be helping at all.


    Phil Wilson
    Tuesday, May 24, 2011 6:09 PM
  • Hi Paul,

      I tried unchecking the optimize code option and I created a new setup project. I see the same results with the new install and not much differance. Apart from the setup project, Lets say I am running the software using the debugger in visual studio the startup is a bit faster.  

     

    Do you think checking the optimize code option is a bad idea in general, I don't think it is making much differance to me.

    The application does not do any complex work at startup, it only loads one user control as it starts.




    Wednesday, May 25, 2011 11:37 AM
  •  

    Hi,

     

    Well, /optimize option also tells the common language runtime to optimize code at runtime. If it is not necessary, we disable /optimize option by default.

    If you want to optimized program, I suggest use /Release configuration when finally release the application.

    The Release configuration of your program is fully optimized and contains no symbolic debug information.

     

    Debug and Release Configurations

    Difference between debug and release


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Paul Zhou Monday, May 30, 2011 7:39 AM
    Thursday, May 26, 2011 6:55 AM