I want to know what is the best solution to improve my WPF application.
I know that WPF forces you to do all the UI work on the thread that created the UI. This is a major problem for me, because my UI is very huge and I only have 1 window, so I cannot split 1 thread per window.
When I do pan and zoom, everything needs to be refresh every time, one of my CPU hit 100% usage until all is done.
So I'll try to explain what I have in my application:
- 1 window (size of the screen)
- Virtual panel, 12000 px X 12000 px (where I do pan and zoom)
- About 2000 controls (button, switch, and some other complex controls)
- Behind my controls, I have a big Bitmap for my background, but I split my background in something like 100 smaller bitmap that I stack (because 1 bitmap of 12k pixels by 12k pixels crash my app)
- 10 virtual displays, connected to a distant computer (who feed the bitmap) and refresh their content every 50 ms
- .NET 4.0, multitouch application
So just my application where I can do pan and zoom (without the 10 displays), there is a lot of lag du to the amount of controls, and when I put the display, it double the lag...
My application takes about 1.5 gb of virtual memory.
I searched to use the dispatcher to makes threads when I can but I don't find what I want... everywhere they talked about 1 thread/window... but I only have 1 Window, don't know what to do.
- I cannot split into smaller window.
- I cannot reduce the amount of controls, or the refresh time.
- I cannot change technology (WPF)
So here is the real question: Where can I create new threads to help my render time? To split the job to different CPU...
I found different website where they talked about this... but not answering my question: