I have a puzzle. I “inherited” a very poorly designed and very complex system, which I modernize and rebuild (with my team) in parts. The problem is that the current system has more than 200 users, and they have serious performance problems due to (lack of) design. The most problematic problem at the moment is that a significant amount of work is placed in the user interface thread, which leads to a hang of the graphical interface until the thread is cleared. Most of this work is really needed in the GUI thread, because it updates a large number of fields in the grid due to different calculation results for other threads.
The problem is this: I do not have the resource to re-write the thread model and base classes used here, and the complexity of this work will lead to a significant risk that is unacceptable to my client.
I wanted to know if anyone has any suggestions on how to make the user interface more efficient without affecting the threadnet thread model too much.
My initial thought was that there might be some way to put a “buffer” in front of the actual calls in the UI thread, to make sure the GUI is not overloaded or when it does, to cancel sending it.
Any suggestions would be greatly appreciated.
I know that none of this is perfect, but we are where we are and I really want to give my users the best experience before completing the re-recording in a year!
Thanks!
Update # 1 This is a winforms application ... sorry, this was not clear from the start. The new code is WPF, but these modules are winforms.
Update # 2 I think that I will initially try to change most of BeginInvoke calls to the user interface thread for Invoke by introducing serialization, which we hope will increase the responsiveness of the interface. Any (non-obvious) flaws here that everyone can see?
source share