“High-performance” WPF Charts – the Truth Revealed
by Pasi Tuomainen
This is probably going to upset a lot of software component manufacturers and a lot of developers, who have lately bought “high-performance” charts. What about manufacturers’ claims about Fastest rendering charts? There are a lot of false marketing terms used in the industry, so I’m going to tell the truth, based on facts that anyone can reproduce and verify.
Pasi Tuomainen – Pioneer in high-performance charting
WPF charting background
When Microsoft introduced a new way to render graphics with WPF (System.Windows.Media namespace), that was a major revolution, no doubt, after GDI/GDI+ graphics common in Windows Forms applications. Developing nice-looking applications was easy without actually having to bother oneself with the low-level graphics programming. “WPF is based on DirectX, oh yeah, very cool, so it must be very fast to render!”, it was assumed. That’s a major delusion, as I’m going to prove here.
Software component manufacturers quickly adopted System.Windows.Media rendering in their charting controls, after struggling with bad performance in their GDI/GDI+ charts. Even some new companies were born to develop WPF charts. WPF rendering was supposed to solve all performance problems easily. Probably every WPF chart was then called “High-performance chart”. But what is true High-performance and what’s actually not, let me enlighten this a little bit.
Benchmarking WPF and WinForms charts
We benchmarked GDI/GDI+ based WinForms charts against a low-level DirectX accelerated LightningChart for WinForms back in 2010, and now, System.Windows.Media rendered WPF charts against low-level DirectX accelerated LightningChart for WPF. The benchmarks are presented in detail here.
|WPF||System.Windows.Media charts||LightningChart for WPF|
|Rendering delay of line series of 1,000,000 points||9.4 seconds||0.021 s|
|Scrolling real-time data point appending capacity / sec||1,000||10,000,000|
|WinForms||GDI/GDI+ charts||LightningChart for WinForms|
|Rendering delay of line series of 1,000,000 points||5 s||0.029 s|
|Scrolling real-time data point appending capacity / sec||1,000||5,000,000|
WPF benchmark was performed with a faster PC. In these tests, charts that don’t render the line as a poly-line, or remove data points by down-sampling were failed because of their wrong rendering output. The conclusion is: no practical improvement in charting performance has been achieved by changing from GDI/GDI+ to System.Windows.Media. In general, WPF charts are slower than WinForms charts.
The lack of real rendering power of System.Windows.Media has led several chart manufacturers to use desperate measures in improving their performance. But that’s only cheating and shows total disrespect to the customers that don’t check these things by themselves. For example, you have data of 100,000 points, with Y values of 0…1000. But what the darn, you see only a fraction of your values there, or your data curve is much lower than it should be, the curve fluctuates between 250…750. That is the result of down-sampling or reduction of data points by averaging them. Also rendering a high-low fill trick instead of a poly-line is being used, which has its own side effects.
Claims about Fastest Rendering Charts
Then I’m going to address the manufacturers’ claims of Fastest rendering charts. Infragistics is marketing their WPF chart as “World’s fastest WPF Data Chart”. They have compared their chart probably against to the slowest WPF chart they’ve found and highlight results in their benchmarks that they’ve achieved by high-low fill instead of poly-line rendering.
|Fastest rendering WPF chart||LightningChart for WPF||Infragistics||Difference|
|Rendering delay of line series of 100,000 points||3 ms||5080 ms||LC 1700 times faster|
|Scrolling real-time data point appending capacity / sec||10,000,000||1,000||LC 10,000 times faster|
So Infragistics statement is quite far from the truth. Would you call a chart that provides 0.01% of the performance of LightningChart, even as a high-performance chart?
How about WinForms charts then? Xceed markets their WinForms chart with these words “The fastest-rendering chart control on the market!” . They haven’t even released any kind of benchmark documentation to back up their statement.
|Fastest rendering WinForms chart||LightningChart for WinForms||Xceed||Difference|
|Rendering delay of line series of 10,000,000 points||0.264 s||91 s||LC 345 times faster|
|Scrolling real-time data point appending capacity / sec||5,000,000||100||LC 50,000 times faster|
Likewise, Xceed statement is far from the truth. Where do these claims come from? Marketing person wakes up in the middle of the night and comes up with a great idea, “let’s start calling our chart as fastest rendering chart in the market, I’m sure it will increase our sales and boss will be happy. Our customers won’t find out the truth anyway”. It must be something like that, because they still continue it after 2 years we’ve proven them wrong.
The definition of High-performance chart is of course subjective, and for basic use where data point count is very low and real-time charting is not needed, many of the charts will perform fast enough. Highest performance can be achieved only by low-level DirectX/OpenGL rendering, not by GDI/GDI+ or WPF’s built-in graphics routines. I just wanted to give you some perspective in this matter, of what kind of difference there is between a real High-performance chart and “High-performance” chart. Difference of 34,500 % … 5,000,000 % or even more.