C
C#2y ago
binstarjs

Wpf choppy UI thread performance when launched without debugging

I have a WPF application that exatly as the title says, choppy UI thread performance when launched WITHOUT debugging. However, i do not understand as launching it with debugging enabled should make the performance worse BUT this is not, the UI thread is very responsive and it does not have performance hiccups/stuttering like when launched without debugging. Why does this happen? anyone know how to solve this? Below is the video of what it looks like when launched with vs without debugging. Please pay attention to the red encircled thingy (Debug - Thread Responsivity), that UI element update constantly and if it stops it means my UI thread does blocked A little bit of more context: The application instructed to process a lot of long-running tasks to draw image pixels like in the video, and it needs to perform CPU intensive calculation before changing pixel color. To prevent my UI thread from freezing, i do the long-running tasks in separate thread using System.Threading.Task. The UI thread and the worker thread do not communicate at all unless when it needs to put the actual pixel image, so i believe the worker thread is not the culprit of making the UI thread unresponsive
2 Replies
binstarjs
binstarjs2y ago
launched without debugging (choppy, bad user experience), the encircled thingy stops very briefly and as i pan the view around, it is very choppy, its unacceptable
binstarjs
binstarjs2y ago
launched with debugging (very responsive), the encircled thingy updates constantly and never stops, means my UI thread is never blocked at all