How to make apps startup faster?

Hi!

Ive written an app in C#. The overall performance is great but the starting up of the app is really laggy. How can I make the apps startup smooth

Matt



Answer this question

How to make apps startup faster?

  • MisterMoon

    The Framework is a monster. The first time you load an app that needs it...welcome to dogville.

    end of story.



  • Binu Jeesman

    I have it set to Release and I also removed all unnecessary code. It might be because the app has a lot of buttons and menus. Would threads help

    ~Matt


  • Mike_25

     

    Practical Tips for Boosting the Performance of Windows Forms Apps

    Thanks alot ;-) for sharing a great article. Yes, using both these articles will really increase the worth of your application in performance.

    Cheers ;-)



  • Trevor E Hilder

    If all other things are ok as mentioned by these guys in their post. Then Final step is to build a native image of your application through ngen.exe utility with .Net Framework SDK. It really improves the startup speed.

    For more information see this great article:

    http://msdn.microsoft.com/msdnmag/issues/05/04/NGen/

    I hope the difference will be obvious.

    Cheers ;-)



  • MrWolf78

    the other thing I should have suggested (but too late) was to make sure that you are not using Win32/API calls within your app unless you REALLY need to as it does decrease performance. If there is a .NET way of doing it, do it that way than creating your own way of doing things.

    Since you have stated that the app has alot of buttons/controls - having a background thread could/may help but threading in itself can be expensive sometimes.

    you could place a start up screen "loading"...and load the other form in the background, once done, raise an event to indicate that its finished loading and ready to be shown so then you simply show that form and hide your splash screen.

    You could also, not recommended but may help, use Application.DoEvents() to process any messages that maybe waiting in the "queue" and see if it helps, but may not.

    There are a few ways of doing things, each has an advantage - hope a few people here can chip in and share their views and see what we can do to come up with a reasonable solution together!



  • tenchyz

    RizwanSharp wrote:

    http://msdn.microsoft.com/msdnmag/issues/05/04/NGen/

    Good link...but I see his one link and raise him two:

    Read up on great tips for faster loading of Winforms in Practical Tips for Boosting the Performance of Windows Forms Apps see the section Faster UI Loading for the splash screen info for initial slugishness. For more general information see the Winform FAQ.

  • Joe Kehnast

    See all the assemblies that are loading on start. Try to avoid some of them at least on startup, especialy to big ones. If you have a big job on start, you can put it in a separate thread and the main app will start faster and job will finish later.

  • Omniscient

    well make sure that you are not using objects/items that are not necessary. These can have some impact.

    It also depends what your application is doing on startup - any chance for code for that

    you may also wish to build the solution, and run it, under release mode than the default debugging mode, as the release mode cuts out a good few bits (pretty much no debugging stuff) which can increase performance.

    Some code on your app startup would be ideal :-)



  • How to make apps startup faster?