Tutorial :High-Performance UI Framework for .NET



Question:

My current task is to develop a software for measurement and testing purposes which will communicate with various devices. Because i have to assume that there will be a high amount of data transferred from the devices that needs to be displayed in some plotting component or similar, the UI framework used should be as fast and responsive as possible.

I have a few years experience in WPF, but i think it will not be the best choice performance-wise. I am considering using Windows Forms at the moment, but i would like to explore some options first.

Do you know any good UI frameworks for .NET (wrappers for native frameworks are fine, too) and what is your experience using them? Thanks!


Solution:1

Build a prototype to see if there are actually performance problems.

Choosing Windows Forms over WPF seems questionable if it is purely based on assumptions.


Solution:2

So, let's say you have 1.000 readings per second. Do you really think you should refresh display 1000 times per second?

Such display would be meaningless. There would be too much flicker on screen. If you display text data - it would scroll too fast or it would flicker and it could not be read.

Movies display 24 frames per second, everything faster than that is irrelevant for human eyes. What can you get if your system displays more changes per second? Humans cannot react that fast. So if you need system adjustment several times per second, than you must have some automatic systems.

You should generally reconsider goals that you want to accomplish with your UI.
Search Google for "Dashboard Design".

I worked on system that controlled water wells (pumps and valves) some 12-13 years ago when state of the art was Pentium II. We did it with Delphi 2 and Windows NT and it had nice graphic representation of system. Performance problematic part were serial interfaces that we used for reading data. Display was way faster than that.


Solution:3

It's a common problem that many line of business charts aren't able to scale to render massive datasets as required in scientific or financial applications. This is especially apparent in retained mode rendering engines like WPF and Silverlight, which can be very slow when you need to rapidly update the screen, although this applies to most GUI technologies.

As a response to this need, I've created a high performance WPF/SL chart component called SciChart. SciChart seeks to fill the gap for ultra high performance scientific / stock charts and as part of its optimisation it uses proprietary resampling algorithms to reduce the dataset before drawing, immediate mode rendering and a host of other optimisations such as object pooling and resource re-use.

Please click on the SciChart link to view a performance demonstration (requires Silverlight 4 - WPF version also available). The chart is able to draw multiple series totalling 5 or 6-figure point counts at interactive framerates (20-50FPS depending on hardware). This is equivalent to around 2million datapoints per second (100,000 datapoints @ 20FPS). A full version ready for commercial licensing will be available very soon, possibly by end Jan 2012.

In response to your specific requirement, note that the WPF/SL rendering pipeline will only render at a maximum of 60FPS, which is typically the monitor refresh rate. I would suggest in this case batching the data and appending to the chart in the CompositionTarget.Rendering event would be the best solution. SciChart supports batch updates with one render at the end via its API, which is compatible with code-behind or MVVM. The result is, you can push data as fast as you like to the chart, but it only renders as fast as WPF/SL is able to render. More than 30FPS is virtually undetectable by human eye.

Another consideration you may want is memory footprint and CPU as well as speed. I would choose carefully when evaluating chart components as WPF/SL can be a major memory hog!


Solution:4

Sounds like the extra precision of WPF would make this an ideal candidate.

Funny enough while typing this there is an ad next to me typing this which says Radcontrols for WPF when you are serious about performance, with some plotting in it.

Might be what your looking for :)

Also keep in mind that WPF got quite a performance boost with the 4.0 release.


Solution:5

I think .Net form should work, since VB6 UI does.

I developed similar application which plots Line Graph on screen but it was in VB6, and also same time it logs the data in txt file. there are 700 + read per second(Analog to Digital signal conversion).

You may need to plot the data by coding(not using third party control), its another option.

Hope this will give you some idea.


Solution:6

You could use XNA or some other 3D api to draw the graphics but this might be overkill.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »