Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
XamDataChart performance issues depending on number of points and signal shape
posted

Hi!

I am facing some performance issues when using a XamDataChart.

I've an example, taken from another post

https://ko.infragistics.com/community/forums/f/ultimate-ui-for-wpf/70986/how-to-bind-multiple-collections-to-single-xamdatachart

I modified this example a little bit so that multiple signals are bound to one common x-axis and one common y-xaxis. There are 5 different signals, each consisting of about 10000 points randomly generated. When a signal is selected or deselected in the listbox the update of the XamDataChart is fast.

This is my first example:

Ex1.zip

Then I modified this example further to include an algorithm to compute a specific signal, 5 times the same signal. This signal is a rectangular signal consisting of about 480 points. Here the update of the XamDataChart is pretty slow (compared to example 1 with about 10000 points)

Ex2.zip

Where does this performance degradation come from?!

How can I increase the performance?!

Best regards,

   Christoph

Parents
  • 34810
    Offline posted

    Hello Christoph,

    I have been investigating into this behavior that you are referring to, and unfortunately, this is a known limitation of the XamDataChart of the control imposed by the WPF rendering methods used for the chart, and there isn't really too much we can do about it without introducing our own rendering methods.

    Essentially, WPF does not play well with a highly fluctuating, seemingly random set of XamDataChart points here because of the Path that is generated as a result of these points. If you were to profile your application using a sort of diagnostic tool, I would imagine that you would see that most of the performance time spent here is in WPF's hardware rasterizer. WPF uses hardware acceleration as its default rendering mechanism, which means it uses Direct2D for rendering via the GPU. This normally makes performance faster, but there is an issue with Direct2D with this type of highly fluctuating shape, in which the rendering algorithm does not work well. This leads to Direct2D needing to do some conversions with the WPF path data, which makes the rendering operations happen primarily on the CPU rather than the GPU, and so there is a performance issue in WPF with this type of fluctuating path geometry.

    One question I would like to know in this case is if your real-world data will look like this, or if it will be more linear with less fluctuation? For example, if you take a look at the following forum thread where a similar issue was discussed, I have attached a more-linear sample project with a series that has 1 million data points and the performance is very responsive: https://ko.infragistics.com/community/forums/p/108504/511375.aspx.

    If your real-world data will look like this, it is worth re-noting that this issue has come up in the past, and one of our developers has designed a custom-series workaround that uses a custom rendering method to get around this issue. Personally, I don't completely understand a good part of it, but from what I do understand is that it uses a class called WriteableBitmapEx to render the complex geometry of the series' path figure into a bitmap image, which it can then render to the screen. Essentially, it is a custom series with a custom renderer that bypasses the WPF bottleneck that you currently see with the existing series implementations in the XamDataChart, although this series is much less feature-rich than the ones that currently exist in the chart as it is not an "official" series. It is also not maintained, as it is not part of the Infragistics WPF product. You can find more information about the WriteableBitmapEx class here: https://writeablebitmapex.codeplex.com/.

    I have also attached the sample project that was created some time ago that uses the custom "ImmediateLineSeries" that works around this issue. Simply check any number of checkboxes at the top of the application and then click one of the radio buttons to specify the number of points that you wish to show in a highly fluctuating, but still very responsive plot.

    If you would like to see the ImmediateLineSeries solution more fleshed out into a fully supported series, or perhaps added as a separate rendering method for the chart, I would recommend suggesting a new product idea for this at our WPF Ideas Site, here. This will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.

    Please let me know if you have any other questions or concerns on this matter.

    XamDataChartNoiseDataDemo.zip

Reply Children