Revamp/Rewrite a slow WPF Application
-
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.
-
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.
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.
-
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.
Appreciate your thoughts on this.
-
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.
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)
-
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)
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?
-
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?
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)
-
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)
Sounds Good. Appreciate your prompt response and enlightening on the subject :)
Praveen Raghuvanshi Software Developer
-
Sounds Good. Appreciate your prompt response and enlightening on the subject :)
Praveen Raghuvanshi Software Developer