RSS Feed
News
Jun
23
Android Chart Performance Comparison
Posted by Yuriy on 23 June 2016 09:00 AM

Android Chart Performance: TLDR

In this post, we compare the performance of five of the major Android Charting Libraries vs. our own brand new & upcoming Android Chart: SciChart for Android. In order to conduct a fair comparison, we’ve developed a comparison application which generates several different chart types and measures refresh rate (FPS – Frames per Second) on each chart library.

Our findings were that:

  • AChartEngineGraphView and AndroidPlot had poor real-time performance for an Android Chart Library and were too slow for use in an App which required real-time updates.
  • MPAndroidChart had better performance and was suitable for some cases, e.g. when data updates were infrequent or number of points on the chart were less than a few thousand, but once dataset became larger (above a few thousand points), it also started to slow down.
  • One popular commercial Android Chart library was tested (labelled CompetitorA) which had comparable performance to MPAndroidChart.
  • Finally, the fastest Android Chart was SciChart for Android, which beat all available Android Chart Controls by by a wide margin.

At smaller datasets all the charts appeared fine, however once we increased the volume of data and rate of updating the Android Chart control, all of the above slowed down significantly except for SciChart. In some tests SciChart for Android registered between 2-5x faster than the nearest competitor, and in one, a staggering 255x faster.

For this reason we propose SciChart’s Android Chart as the best Android Chart Library where real-time updates, or visualisation of big-data is required.

How do we Measure Android Chart Performance?

To avoid uncorroborated statements, we’ve tried find out what the most popular Android Charts can offer in terms of speedf. To our big surprise, we haven’t found any performance analysis of the existing charting packages! And that in-spite of the fact that similar questions have been asked a lot at StackOverflow, Quora, etc.! Which means that this question is topical among the Android developer community.

So we’ve created an Android application which performs a comparison of different charting packages. It was designed to help evaluating their performance under different test conditions, ranging from mild to extreme. The following aspects were considered to be the most important for such analysis:

  • Whether a chart crashes under a test-case
  • Measuring FPS on the user interface when a chart is under test conditions
  • The initial launch time of a test
  • Rate of change of data
  • General visual smoothness and UI responsiveness

Who did We Compare Against?

We have compared the performance of Android Charts by SciChart against the most popular and renowned Android charting libraries, including:

  • AChartEngine, an open source charting software library for Android
  • MPAndroid, an open source, cross-platform chart library for Android and iOS
  • Competitor A, a popular commercial cross-platform Android and iOS charting software

We also had a look at

  • GraphView, an open source graph plotting library for Android
  • AndroidPlot, an open source Android library for creating charts

However due to time constraints, plus poor stability and performance of these libraries when large data was appended, we have omitted them from the results – for now.

The Test Setup

What Tests are Run?

There are four different test cases run in our Android Charts Performance Comparison app, under different conditions. They are designed to really really stress the chart, by having huge numbers of series, or points, or many updates per second, with varying thickness of pens / number of pixels filled.

Test 1: NxM Series Test

many_framed

In this test, N series of M points are appended to series, then the chart redraws (the same data) as fast as possible by just resizing the Y-Axis for 10 seconds per test.

The FPS is measured using the Choreographer class from the Android API.

Areas Stressed: Iterating Data Series, Coordinate Transformation and Drawing.

 

Test 2: Scatter Series Test

scatters_framed

In this test, N Scatter points (ellipses) are appended to a series, then the chart redraws. Immediately after, the points are updated in a Brownian motion fashion and the chart is drawn again.

The FPS is measured using the Choreographer class from the Android API.

Areas Stressed: Coordinate Transformation, Geometry Generation (Ellipse) and Drawing.

 

Test 3: FIFO (Scrolling) Series Test

Fifo_framed

In this test N points are appended to a series, but scrolled from right to left (as new points arrive, old are discarded). SciChart for Android has a built-in mode to handle this called Fifo data series which is implemented as a circular buffer. Other chart components you simply remove a point for each point added.

The FPS is measured using the Choreographer class from the Android API.

Areas Stressed: Copying Circular Buffers (FIFO Series), Resampling and Drawing, scrolling.

Test 4: Append Data Test

Append_framedIn this test N/3 points are appended to 3 series, then M points are appended between each draw of the chart. The data is random-walk but we vary noise to create more, or less noisy waves. This has the effect of stressing the actual drawing engine (when more noisy) vs. the update rate when less noisy.

The FPS is measured using the Choreographer class from the Android API.

Areas stressed: Appending Data, Resampling, Auto-Ranging and Drawing.

Test Hardware

We’ve used SciChart Android v.1.0 for this purpose and compared it with the other Android Charts on a number of devices and emulators, among these Samsung Galaxy S6 Edge and Google Nexus 4.

The Test Results

You can find the test results of our Android Chart Performance Comparison below. All test result numbers are in FPS (Frames per second – Higher is Better), meaning, the average number of redraws per second during the test, as measured by the Choreographer class from the Android API.

If a number is missed (blank), it means that a chart failed to run (crash) under a particular test-case.

The final column (SciChart Speedup) is the speed increase of SciChart Android vs. the other Android Charting Packages, e.g. 2.5 means 2.5x faster.

Performance report Sun Apr 24 14_30_50.xlsx - Excel 2016-06-21 19.22.08

Test Results in Chart Form

What Android charting performance comparison would be complete without the results in chart form?

You can find the test results plotted below:

Append Points Test Results

SciChart Android is green, results are FPS (Refresh rate) so higher is better.

AppendPerformance

Fifo Scrolling Test Results

SciChart Android is green, results are FPS (Refresh rate) so higher is better.

FifoPerformance

Scatter Series Test Results

SciChart Android is green, results are FPS (Refresh rate) so higher is better.

ScatterPerformance

NxM Series Test Results

SciChart Android is green, results are FPS (Refresh rate) so higher is better.

NxMPerformance

 

Performance Comparison Conclusions

According to the Performance Comparison Results, Most Android Chart libraries are unsuitable for real-time updates on the chart. Most perform poorly once the amount of data reaches a few thousand points.

By contrast, the Android Charts by SciChart are extremely fast and show robust performance across a number of test cases including scatter charts, scrolling line series, appending line series and multiple series.

 

SciChart should be considered a very strong contender when evaluating real-time Android Charting Libraries for use in either Android Apps or Embedded systems which run the Android operating system.

A version of the test-application is available on request, if you would like to contact us. For legal reasons we can’t publish the names of CompetitorA but if you believe you are that competitor and wish to verify the results or submit a modification to optimize your code, please feel free.

Finally let us know what you think in the comments! If there’s anything else you want us to test, please ask!

Best regards,
Yuriy, SciChart Team

The post Android Chart Performance Comparison appeared first on SciChart - WPF Charts.


Read more »



May
22
Extreme Performance Optimization Survey
Posted by Andrew on 22 May 2016 03:11 PM

From time to time at SciChart HQ, we get asked for even more performance. Yes! I know it’s crazy, SciChart can easily handle 10 million points in real-time (or even up to 100 Million points at 2-4 FPS) in a line-chart, but sometimes we get asked ‘well, can you do more?’

So … wait … you want more than 10s of millions of points? … Ok then! .. 

So we had a go to try to optimize certain critical paths of SciChart’s WPF Chart. Right now, we’re already using unsafe code (pointer arithmetic in .NET) for our performance critical algorithms, plus DirectX for drawing, however there is the potential to move certain critical routines over to C++ with SSE (Streaming SIMD Extensions), which allow us to vectorize and hence accelerate certain numerical methods.

Simd-Performance-Wpf-Chart-Prototype

SciChart WPF Charts SIMD Prototype. 5x performance improvement for some chart types. More performance is possible if we do a whole program optimization.

Our prototype was pretty good! In just a few days, we managed to increase the overall performance of Resampling algorithms (used for lossless timeseries reduction) by 3-3.5x using C++/SSE*. That means a time-series chart which renders comfortably with 10M points at 30FPS can now render at the same framerate with 40M points. Or a chart that can render (albeit slowly) with 100M points can now handle 400M points.

But resampling doesn’t improve everything. In fact, from our own internal tests and extensive experience building High Performance Chart controls we know that Measuring and Improving Charting Performance is extremely complex and with many different pathways, we have to change many parts of the code to provide an optimum overall solution to deliver super High Performance WPF Charts.

For instance, we can move our rendering code to C++. Currently all our rendering is done in C# using interfaces and we transform points one at a time from data to pixel coordinates and vertices! The whole thing could be improved – a lot – if we moved some parts of the code over to C++ and started working in batches.

So, before we embark on this road of painstaking optimization, we’d like to know from you, our user base, how important is it to you? We have a simple Yes or No question “Should we optimize for even more performance?”.

* This optimization introduces a dependency on the Visual C++ Runtime, which must be installed on end-user PCs (pretty easy, but you should be aware of it).

Survey

Please find the survey below. If you’d like to comment, please do so at the footer of this article.

Create your own user feedback survey

The post Extreme Performance Optimization Survey appeared first on SciChart.


Read more »




CONTACT US

Not sure where to start? Contact us, we are happy to help!


CONTACT US

SciChart Ltd, 16 Beaufort Court, Admirals Way, Docklands, London, E14 9XL. Email: Legal Company Number: 07430048, VAT Number: 101957725