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. Design and Architecture
  4. Revamp/Rewrite a slow WPF Application

Revamp/Rewrite a slow WPF Application

Scheduled Pinned Locked Moved Design and Architecture
csharpwpfwcfperformancequestion
8 Posts 3 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.
  • P Offline
    P Offline
    Praveen Raghuvanshi
    wrote on last edited by
    #1

    We have a WPF/Winform standalone enterprise application and it has become an Elephant with lot of features. This has impacted the performance immensely and adding/modifying anything is a big pain now. The application is used to configure the hardware parameters and communicates two-way within local network. The application follows MVVM architecure, however due to legacy code everything can't be changed to MVVM. We are planning to revamp/rewrite the application and looking for the options available. A typical usage of the application display around 1.2GB memory in task manager. The application has canvas with rectangular objects displayed in a network fashion. If we have around 200 objects and perform select all and drag/drop to some other location, it takes around 5 seconds and its not smooth. Reason for slow application: - Mix of WPF and Winform modules. When we create few objects, legacy code is in Winform which creates controls dynamically. As a result operation can't be pushed to background thread. - Lot of Styles and Templates to give a good look and feel. - Lot of objects stays in the memory. Some objects are duplicated for copy/paste functionality. - Third party libraries - Caliburn for MVVM : Allow easy DI, however as we have lot of objects, getting an object from huge collection of objects makes it slow. - Infragistics Technology in consideration: Revamp: - Web Services: Reuse the C# code and move it to some web service. WCF/Web API - Windows Services: Keep most of the things in the windows service and make the WPF client thin - Improve performance - Make code asynchronous as much as possible. - Optimize styles and templates - Perform time consuming operations on the web services on the cloud - Store objects in the database and use information from there. Rewrite: - Web based application using new technology stack such as MEAN. Note: Team Expertise is in .Net/C#, however we are open to other technologies. Question: Revamp OR Rewrite the application? Which technology stack to consider? Looking forward for your valuable suggestion.

    J L 2 Replies Last reply
    0
    • P Praveen Raghuvanshi

      We have a WPF/Winform standalone enterprise application and it has become an Elephant with lot of features. This has impacted the performance immensely and adding/modifying anything is a big pain now. The application is used to configure the hardware parameters and communicates two-way within local network. The application follows MVVM architecure, however due to legacy code everything can't be changed to MVVM. We are planning to revamp/rewrite the application and looking for the options available. A typical usage of the application display around 1.2GB memory in task manager. The application has canvas with rectangular objects displayed in a network fashion. If we have around 200 objects and perform select all and drag/drop to some other location, it takes around 5 seconds and its not smooth. Reason for slow application: - Mix of WPF and Winform modules. When we create few objects, legacy code is in Winform which creates controls dynamically. As a result operation can't be pushed to background thread. - Lot of Styles and Templates to give a good look and feel. - Lot of objects stays in the memory. Some objects are duplicated for copy/paste functionality. - Third party libraries - Caliburn for MVVM : Allow easy DI, however as we have lot of objects, getting an object from huge collection of objects makes it slow. - Infragistics Technology in consideration: Revamp: - Web Services: Reuse the C# code and move it to some web service. WCF/Web API - Windows Services: Keep most of the things in the windows service and make the WPF client thin - Improve performance - Make code asynchronous as much as possible. - Optimize styles and templates - Perform time consuming operations on the web services on the cloud - Store objects in the database and use information from there. Rewrite: - Web based application using new technology stack such as MEAN. Note: Team Expertise is in .Net/C#, however we are open to other technologies. Question: Revamp OR Rewrite the application? Which technology stack to consider? Looking forward for your valuable suggestion.

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #2

      Praveen Raghuvanshi wrote:

      This has impacted the performance immensely and adding/modifying anything is a big pain now.

      Either you are using the word "performance" incorrectly or there are two parts to that sentence which conceptually have nothing to do with each other. That said it is possible that the former is a result of the latter but that is likely an assumption without proof.

      Praveen Raghuvanshi wrote:

      If we have around 200 objects and perform select all and drag/drop to some other location, it takes around 5 seconds and its not smooth.

      Based on that and the rest of the description this suggests there is a design problem. And that is the cause of the performance issue. Could also be a requirements issue. One doesn't solve design problems with technology but rather with better designs. And one definitely doesn't solve requirement bugs with technology. As described the application footprint on a modern machine is trivial. Presumably this is being run on modern machines right?

      Praveen Raghuvanshi wrote:

      Looking forward for your valuable suggestion.

      Start by profiling the application while users are using it. That allows you to both determine what the actual performance problems are and also determine what real usage looks like.

      P 1 Reply Last reply
      0
      • J jschell

        Praveen Raghuvanshi wrote:

        This has impacted the performance immensely and adding/modifying anything is a big pain now.

        Either you are using the word "performance" incorrectly or there are two parts to that sentence which conceptually have nothing to do with each other. That said it is possible that the former is a result of the latter but that is likely an assumption without proof.

        Praveen Raghuvanshi wrote:

        If we have around 200 objects and perform select all and drag/drop to some other location, it takes around 5 seconds and its not smooth.

        Based on that and the rest of the description this suggests there is a design problem. And that is the cause of the performance issue. Could also be a requirements issue. One doesn't solve design problems with technology but rather with better designs. And one definitely doesn't solve requirement bugs with technology. As described the application footprint on a modern machine is trivial. Presumably this is being run on modern machines right?

        Praveen Raghuvanshi wrote:

        Looking forward for your valuable suggestion.

        Start by profiling the application while users are using it. That allows you to both determine what the actual performance problems are and also determine what real usage looks like.

        P Offline
        P Offline
        Praveen Raghuvanshi
        wrote on last edited by
        #3

        Appreciate your thoughts on this.

        1 Reply Last reply
        0
        • P Praveen Raghuvanshi

          We have a WPF/Winform standalone enterprise application and it has become an Elephant with lot of features. This has impacted the performance immensely and adding/modifying anything is a big pain now. The application is used to configure the hardware parameters and communicates two-way within local network. The application follows MVVM architecure, however due to legacy code everything can't be changed to MVVM. We are planning to revamp/rewrite the application and looking for the options available. A typical usage of the application display around 1.2GB memory in task manager. The application has canvas with rectangular objects displayed in a network fashion. If we have around 200 objects and perform select all and drag/drop to some other location, it takes around 5 seconds and its not smooth. Reason for slow application: - Mix of WPF and Winform modules. When we create few objects, legacy code is in Winform which creates controls dynamically. As a result operation can't be pushed to background thread. - Lot of Styles and Templates to give a good look and feel. - Lot of objects stays in the memory. Some objects are duplicated for copy/paste functionality. - Third party libraries - Caliburn for MVVM : Allow easy DI, however as we have lot of objects, getting an object from huge collection of objects makes it slow. - Infragistics Technology in consideration: Revamp: - Web Services: Reuse the C# code and move it to some web service. WCF/Web API - Windows Services: Keep most of the things in the windows service and make the WPF client thin - Improve performance - Make code asynchronous as much as possible. - Optimize styles and templates - Perform time consuming operations on the web services on the cloud - Store objects in the database and use information from there. Rewrite: - Web based application using new technology stack such as MEAN. Note: Team Expertise is in .Net/C#, however we are open to other technologies. Question: Revamp OR Rewrite the application? Which technology stack to consider? Looking forward for your valuable suggestion.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Praveen Raghuvanshi wrote:

          Rewrite the application?

          You might want to read about what happened to Netscape Navigator. I'd recommend replacing parts of the old system, bit by bit, instead of replacing the entire app at once.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

          P 1 Reply Last reply
          0
          • L Lost User

            Praveen Raghuvanshi wrote:

            Rewrite the application?

            You might want to read about what happened to Netscape Navigator. I'd recommend replacing parts of the old system, bit by bit, instead of replacing the entire app at once.

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

            P Offline
            P Offline
            Praveen Raghuvanshi
            wrote on last edited by
            #5

            Thanks for sharing the strategy and quoting the story the of Netscape Navigator. Recently, I came across the developing the software using Microservices and I am planning to consider it. Can you share a strategy for "Replacing parts of the old system, bit by bit"? I saw you have a good experience in C# and Winform. Maybe something you can share from that experience. Have you ever moved or thought of moving Winform application to WPF?

            L 1 Reply Last reply
            0
            • P Praveen Raghuvanshi

              Thanks for sharing the strategy and quoting the story the of Netscape Navigator. Recently, I came across the developing the software using Microservices and I am planning to consider it. Can you share a strategy for "Replacing parts of the old system, bit by bit"? I saw you have a good experience in C# and Winform. Maybe something you can share from that experience. Have you ever moved or thought of moving Winform application to WPF?

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Praveen Raghuvanshi wrote:

              Microservices and I am planning to consider it.

              If you can manage a lot of them, yes; otherwise you might end up with ravioli-code[^].

              Praveen Raghuvanshi wrote:

              Have you ever moved or thought of moving Winform application to WPF?

              Done a few migrations, but for my own stuff I still prefer WinForms.

              Praveen Raghuvanshi wrote:

              Can you share a strategy for "Replacing parts of the old system, bit by bit"?

              You rip out a form and replace it. Once that works, you move to the next form. Start at the forms that gets the most complaints or the one with the most active bugs in your issue-tracker. Once you now how many screens, and how long it takes to migrate a single screen, you can make a guess about the total time that will be required.

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

              P 1 Reply Last reply
              0
              • L Lost User

                Praveen Raghuvanshi wrote:

                Microservices and I am planning to consider it.

                If you can manage a lot of them, yes; otherwise you might end up with ravioli-code[^].

                Praveen Raghuvanshi wrote:

                Have you ever moved or thought of moving Winform application to WPF?

                Done a few migrations, but for my own stuff I still prefer WinForms.

                Praveen Raghuvanshi wrote:

                Can you share a strategy for "Replacing parts of the old system, bit by bit"?

                You rip out a form and replace it. Once that works, you move to the next form. Start at the forms that gets the most complaints or the one with the most active bugs in your issue-tracker. Once you now how many screens, and how long it takes to migrate a single screen, you can make a guess about the total time that will be required.

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

                P Offline
                P Offline
                Praveen Raghuvanshi
                wrote on last edited by
                #7

                Sounds Good. Appreciate your prompt response and enlightening on the subject :)

                Praveen Raghuvanshi Software Developer

                L 1 Reply Last reply
                0
                • P Praveen Raghuvanshi

                  Sounds Good. Appreciate your prompt response and enlightening on the subject :)

                  Praveen Raghuvanshi Software Developer

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  You're welcome :)

                  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