WPF Bottleneck Bypass

I like to make efficient applications and often look at concurrency and multithreading to improve application responsiveness, etc., but lately, my attempts always seem to be blocked by single-threaded WPFs. No matter how efficient and parallel my code is, WPF seems to constantly stop my user interface and makes my application incredibly unresponsive - sometimes waiting for a window to render can take precious seconds (where even the mouse cursor will not move). I find this frustrating as it seems that I can do nothing to speed up the process.

So my question is: is there anything I can do to improve responsiveness in my WPF application? My windows tend to be quite complex in style and composition, and I'm already using StackPanels virtualization.

To illustrate my problem: I have a text box that acts like a search box, and I want the results to be displayed on the go as user types (each result is encapsulated in UserControl and displayed in ItemsControl). I use background threads to do a search. The problem is that when WPF displays the search results, which completely closes the user interface to print for a few seconds at a time, while WPF is selected, making all the "results as you type" not very viable.

Is there any way to avoid a user interface thread bypass when rendering WPF?

+3
source share
1 answer

Given that you are already using threads to retrieve data, I can only assume that the returned datasets are large enough to cause a slowdown. (Could you provide some indicators there?) For example, you might have a stream receiving an array of names, but if the result is in many thousands, then linking will definitely have a performance hit.

, , - , ( TOP sql, Sql Server) , , , . , , .

+1

Source: https://habr.com/ru/post/1760212/


All Articles