Click here to Skip to main content
15,921,643 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I have a winform application that receives data from multiple serial ports and displays the received data in multiple labels. I'm receiving the data around every 500 ms.

I have also other controls in my UI with which users can interact while viewing the information received.

The problem is that while users interact with the application the rest of the labels are frozen until the user stops using the UI.

there is some method to improve the performance of the UI?

Note: The processing of the received data is done in another thread (since the serial ports works that way) and then the Text property of the labels is changed using:

VB
If Me.InvokeRequired Then
    Me.BeginInvoke(....)
Else
   Me.Label1.Text = newValue
    ...
End If
Posted
Updated 7-Jun-12 8:00am
v3

How many labels are we talking about here? Since controls have an overhead, you might have to paint these items yourself for better performance.

Though, twice a second isn't really a performance killer unless you've got a machine that was made 10 years ago.

As for the user interaction stopping the UI, this is probably the biggest clue that you've done something very wrong. If the user it typing in a textbox, it show have no effect at all on the other labels painting themselves.

Without seeing your code, it's pretty much impossible to tell you what's wrong.
 
Share this answer
 
v2
Comments
Maciej Los 7-Jun-12 15:40pm    
Good point, my 5!
cass3000 18-Jul-12 16:17pm    
Thanks Dave, after an detailed analysis of my code, I found the "performance killer" process. So I split this process in multiple parallel tasks and the UI refresh performance improved drastically.

Thanks for your answer.
 
Share this answer
 
Comments
Dave Kreskowiak 7-Jun-12 15:15pm    
Where in his post did you see anything that says he was writing an ASP.NET app?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900