Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. speed up application

speed up application

Scheduled Pinned Locked Moved C#
performancehelp
14 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V V 0

    Hi guys, Our application takes some time to load. I already tried some tricks like the suspend layout when loading combo boxes and only loading them when necessary etc. but it's still slow. Especially the first time. (because of JIT compiler) A while ago there was a link here on CP to some article on the web that enables you to leave the JIT compilation, but I can't find it anymore. If somebody could point me out to that one, that would be great. Any tricks you know to speed up the application is helpful, but we don't want too many code changes. Thanks for your help!

    I've found a living worth working for, but I haven't found work worth living for. :beer:
    :jig:

    Y Offline
    Y Offline
    yueue
    wrote on last edited by
    #2

    Make a form that print 'loading...' and show it before your application run :laugh:

    V 1 Reply Last reply
    0
    • V V 0

      Hi guys, Our application takes some time to load. I already tried some tricks like the suspend layout when loading combo boxes and only loading them when necessary etc. but it's still slow. Especially the first time. (because of JIT compiler) A while ago there was a link here on CP to some article on the web that enables you to leave the JIT compilation, but I can't find it anymore. If somebody could point me out to that one, that would be great. Any tricks you know to speed up the application is helpful, but we don't want too many code changes. Thanks for your help!

      I've found a living worth working for, but I haven't found work worth living for. :beer:
      :jig:

      W Offline
      W Offline
      WillemM
      wrote on last edited by
      #3

      I recommend precompiling the application using NGen. This creates a native image of the application, this makes the application start a little faster and run a little faster. Quick question: How many controls do you use on the form and is the form databound to a lot of datasources? Having a lot of controls on a form makes the application slower, especially when layering them using groupboxes and panels. Also loading from a database the first time (and often after that too) makes the application slow. You can fake the user by loading the data using async methods. This makes the application more responsive. There could be more tricks, but this is what I know at the moment.

      WM.
      What about weapons of mass-construction?

      V 2 Replies Last reply
      0
      • W WillemM

        I recommend precompiling the application using NGen. This creates a native image of the application, this makes the application start a little faster and run a little faster. Quick question: How many controls do you use on the form and is the form databound to a lot of datasources? Having a lot of controls on a form makes the application slower, especially when layering them using groupboxes and panels. Also loading from a database the first time (and often after that too) makes the application slow. You can fake the user by loading the data using async methods. This makes the application more responsive. There could be more tricks, but this is what I know at the moment.

        WM.
        What about weapons of mass-construction?

        V Offline
        V Offline
        V 0
        wrote on last edited by
        #4

        WillemM wrote:

        I recommend precompiling the application using NGen

        That was the thing I lost. Thank you so much. We don't have that many controls, but a lot of data is in them. The entire logic seems simple at the outside, but is very complex at the inside. That's why we loose so much time. Furthermore, on my laptop, speed is acceptable, but the client works on old(er) machines. thanks for your help !!

        I've found a living worth working for, but I haven't found work worth living for. :beer:
            :jig:

        1 Reply Last reply
        0
        • Y yueue

          Make a form that print 'loading...' and show it before your application run :laugh:

          V Offline
          V Offline
          V 0
          wrote on last edited by
          #5

          I thought of that :laugh:

          I've found a living worth working for, but I haven't found work worth living for. :beer:
              :jig:

          1 Reply Last reply
          0
          • W WillemM

            I recommend precompiling the application using NGen. This creates a native image of the application, this makes the application start a little faster and run a little faster. Quick question: How many controls do you use on the form and is the form databound to a lot of datasources? Having a lot of controls on a form makes the application slower, especially when layering them using groupboxes and panels. Also loading from a database the first time (and often after that too) makes the application slow. You can fake the user by loading the data using async methods. This makes the application more responsive. There could be more tricks, but this is what I know at the moment.

            WM.
            What about weapons of mass-construction?

            V Offline
            V Offline
            V 0
            wrote on last edited by
            #6

            Can I ask you a little question: I've found this article -> Ngen[^]. As I understand correctly it doesn't change anything in your exe, it just has a compiled 'image' in a service. this would mean I need to use ngen again if I install on another cpu. Here's my problem: The NGen tool comes with VS2005 and on the client machine we only have the framework installed. So what did I miss? again, tnx for your help!

            I've found a living worth working for, but I haven't found work worth living for. :beer:
                :jig:

            D 1 Reply Last reply
            0
            • V V 0

              Can I ask you a little question: I've found this article -> Ngen[^]. As I understand correctly it doesn't change anything in your exe, it just has a compiled 'image' in a service. this would mean I need to use ngen again if I install on another cpu. Here's my problem: The NGen tool comes with VS2005 and on the client machine we only have the framework installed. So what did I miss? again, tnx for your help!

              I've found a living worth working for, but I haven't found work worth living for. :beer:
                  :jig:

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #7

              NGen is part of the .NET Framework, not Visual Studio. For 1.1, you'll find it in C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322.

              Dave Kreskowiak Microsoft MVP - Visual Basic

              V R 2 Replies Last reply
              0
              • D Dave Kreskowiak

                NGen is part of the .NET Framework, not Visual Studio. For 1.1, you'll find it in C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322.

                Dave Kreskowiak Microsoft MVP - Visual Basic

                V Offline
                V Offline
                V 0
                wrote on last edited by
                #8

                that's why I couldn't find it, I was searching under program files :doh:. Tnx a lot for your help.

                I've found a living worth working for, but I haven't found work worth living for. :beer:
                    :jig:

                1 Reply Last reply
                0
                • D Dave Kreskowiak

                  NGen is part of the .NET Framework, not Visual Studio. For 1.1, you'll find it in C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322.

                  Dave Kreskowiak Microsoft MVP - Visual Basic

                  R Offline
                  R Offline
                  RizwanSharp
                  wrote on last edited by
                  #9

                  I also have a question abour pre compilation. Doesnot we need to precompile on different hardware Configuration? A best Precompiled Image of assembly may not even good at your hardware? Am I right? Or please give me some more info. Best regards, Rizwan Ahmed

                  D W 2 Replies Last reply
                  0
                  • R RizwanSharp

                    I also have a question abour pre compilation. Doesnot we need to precompile on different hardware Configuration? A best Precompiled Image of assembly may not even good at your hardware? Am I right? Or please give me some more info. Best regards, Rizwan Ahmed

                    D Offline
                    D Offline
                    Dave Kreskowiak
                    wrote on last edited by
                    #10

                    NGen generates binaries that are VERY processor specific. If you use NGen on a Pentium IV, the code won't work on a Pentium III. NGen is best used during application installation. After the app is installed, you can have a Custom Action precompile any/all of your assemblies so as to reduce the startup time as much as possible.

                    Dave Kreskowiak Microsoft MVP - Visual Basic

                    R 1 Reply Last reply
                    0
                    • D Dave Kreskowiak

                      NGen generates binaries that are VERY processor specific. If you use NGen on a Pentium IV, the code won't work on a Pentium III. NGen is best used during application installation. After the app is installed, you can have a Custom Action precompile any/all of your assemblies so as to reduce the startup time as much as possible.

                      Dave Kreskowiak Microsoft MVP - Visual Basic

                      R Offline
                      R Offline
                      RizwanSharp
                      wrote on last edited by
                      #11

                      Exactly this is what I was thinking of. Can you point any article that uses acustom action? Do I have to make a seperate application for precompiling it using System.Diagnostics.Process.Start()??? Best Regards, Rizwan

                      D 1 Reply Last reply
                      0
                      • R RizwanSharp

                        Exactly this is what I was thinking of. Can you point any article that uses acustom action? Do I have to make a seperate application for precompiling it using System.Diagnostics.Process.Start()??? Best Regards, Rizwan

                        D Offline
                        D Offline
                        Dave Kreskowiak
                        wrote on last edited by
                        #12

                        This[^] is all I know of. And no, you don't have to write a seperate application to do this. You can include the code in the custom action.

                        Dave Kreskowiak Microsoft MVP - Visual Basic

                        R 1 Reply Last reply
                        0
                        • D Dave Kreskowiak

                          This[^] is all I know of. And no, you don't have to write a seperate application to do this. You can include the code in the custom action.

                          Dave Kreskowiak Microsoft MVP - Visual Basic

                          R Offline
                          R Offline
                          RizwanSharp
                          wrote on last edited by
                          #13

                          Thanks, I check it Regards

                          1 Reply Last reply
                          0
                          • R RizwanSharp

                            I also have a question abour pre compilation. Doesnot we need to precompile on different hardware Configuration? A best Precompiled Image of assembly may not even good at your hardware? Am I right? Or please give me some more info. Best regards, Rizwan Ahmed

                            W Offline
                            W Offline
                            WillemM
                            wrote on last edited by
                            #14

                            Yup, you need to precompile the application every time its installed on a different computer. This is best done during setup. There should be custom actions for it on the internet.

                            WM.
                            What about weapons of mass-construction?

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups