Android Chart Performance Comparison
Tags: chart, android
Published: 2024-05-02 08:56:33

<h1>Android Chart Performance: TLDR</h1>
In this post, we compare the performance of five of the major Android Charting Libraries vs. our own brand new &amp; upcoming <a href="https://www.scichart.com/android-chart-features/">Android Chart: SciChart for Android</a>. 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:
<ul>
 <li><a href="https://github.com/ddanny/achartengine" rel="nofollow">AChartEngine</a>, <a href="http://www.android-graphview.org/" rel="nofollow">GraphView</a> and <a href="http://androidplot.com/" rel="nofollow">AndroidPlot</a> had poor real-time performance for an Android Chart Library and were too slow for use in an App which required real-time updates.</li>
 <li><a href="https://github.com/PhilJay/MPAndroidChart" rel="nofollow">MPAndroidChart</a> 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.</li>
 <li>One popular commercial Android Chart library was tested (labelled CompetitorA) which had comparable performance to <a href="https://github.com/PhilJay/MPAndroidChart" rel="nofollow">MPAndroidChart</a>.</li>
 <li>Finally, the fastest Android Chart was <a href="https://www.scichart.com/android-chart-features/">SciChart for Android</a>, which beat all available Android Chart Controls by by a wide margin.</li>
</ul>
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. <strong>In some tests SciChart for Android registered between 2-5x faster than the nearest competitor, and in one, a staggering 255x faster.</strong>

<em><strong>For this reason we propose <a href="https://www.scichart.com/android-chart-features/">SciChart's Android Chart</a> as the best Android Chart Library where real-time updates, or visualisation of big-data is required.</strong></em>
<h2>How do we Measure Android Chart Performance?</h2>
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 <strong>haven't found</strong> <strong>any performance</strong> <strong>analysis</strong> of the existing charting packages! And that in-spite of the fact that similar questions have been asked a lot at <a href="http://stackoverflow.com/questions/26467376/android-charting-libraries" rel="nofollow">StackOverflow</a>, <a href="https://www.quora.com/unanswered/Which-are-good-realtime-charts-for-iphone-android-and-blackberry" rel="nofollow">Quora</a>, 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:
<ul>
 <li>Whether a chart crashes under a test-case</li>
 <li>Measuring FPS on the user interface when a chart is under test conditions</li>
 <li>The initial launch time of a test</li>
 <li>Rate of change of data</li>
 <li>General visual smoothness and UI responsiveness</li>
</ul>
<h2>Who did We Compare Against?</h2>
We have compared the performance of <a href="https://www.scichart.com/android-chart-features/">Android Charts by SciChart</a> against the most popular and renowned Android charting libraries, including:
<ul>
 <li><a href="http://www.achartengine.org/index.html" rel="nofollow">AChartEngine</a>, an open source charting software library for Android</li>
 <li><a href="https://github.com/PhilJay/MPAndroidChart" rel="nofollow">MPAndroid</a>, an open source, cross-platform chart library for Android and iOS</li>
 <li><strong>Competitor A</strong>, a popular commercial cross-platform Android and iOS charting software</li>
</ul>
We also had a look at
<ul>
 <li><a href="http://www.android-graphview.org/" rel="nofollow">GraphView</a>, an open source graph plotting library for Android</li>
 <li><a href="http://androidplot.com/" rel="nofollow">AndroidPlot</a>, an open source Android library for creating charts</li>
</ul>
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.
<h2>The Test Setup</h2>
<h4></h4>
<h4>What Tests are Run?</h4>
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.

<strong>Test 1: NxM Series Test
</strong>

<a href="https://www.scichart.com/wp-content/uploads/2016/06/many_framed-e1466172063296.png" rel="prettyphoto"><img class="alignleft wp-image-12937 size-medium" src="https://www.scichart.com/wp-content/uploads/2016/06/many_framed-e1466172063296-300x147.png" alt="many_framed" width="300" height="147" /></a>

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 <a href="https://developer.android.com/reference/android/view/Choreographer.html" rel="nofollow">the Choreographer class</a> from the Android API.

<strong>Areas Stressed</strong>: Iterating Data Series, Coordinate Transformation and Drawing.

&nbsp;

<strong>Test 2: Scatter Series Test</strong>

<strong><a href="https://www.scichart.com/wp-content/uploads/2016/06/scatters_framed-e1466172089813.png" rel="prettyphoto"><img class="alignleft wp-image-12938 size-medium" src="https://www.scichart.com/wp-content/uploads/2016/06/scatters_framed-e1466172089813-300x147.png" alt="scatters_framed" width="300" height="147" /></a></strong>

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 <a href="https://developer.android.com/reference/android/view/Choreographer.html" rel="nofollow">the Choreographer class</a> from the Android API.

<strong>Areas Stressed:</strong> Coordinate Transformation, Geometry Generation (Ellipse) and Drawing.

&nbsp;

<strong>Test 3: FIFO (Scrolling) Series Test</strong>

<a href="https://www.scichart.com/wp-content/uploads/2016/06/Fifo_framed-e1466172148219.png" rel="prettyphoto"><img class="alignleft wp-image-12940 size-medium" src="https://www.scichart.com/wp-content/uploads/2016/06/Fifo_framed-e1466172148219-300x150.png" alt="Fifo_framed" width="300" height="150" /></a>

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 <a href="https://developer.android.com/reference/android/view/Choreographer.html" rel="nofollow">the Choreographer class</a> from the Android API.

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

<strong>Test 4: Append Data Test</strong>

<strong><a href="https://www.scichart.com/wp-content/uploads/2016/06/Append_framed-e1466172124746.png" rel="prettyphoto"><img class="alignleft wp-image-12939 size-medium" src="https://www.scichart.com/wp-content/uploads/2016/06/Append_framed-e1466172124746-300x150.png" alt="Append_framed" width="300" height="150" /></a></strong>In 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 <a href="https://developer.android.com/reference/android/view/Choreographer.html" rel="nofollow">the Choreographer class</a> from the Android API.

<strong>Areas stressed:</strong> Appending Data, Resampling, Auto-Ranging and Drawing.
<h4>Test Hardware</h4>
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.
<h2>The Test Results</h2>
You can find the test results of our Android Chart Performance Comparison below. All test result <strong>numbers are in FPS</strong> (Frames per second - <strong>Higher is Better</strong>), meaning, the average number of redraws per second during the test, as measured by <a href="https://developer.android.com/reference/android/view/Choreographer.html" rel="nofollow">the Choreographer class</a> 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.

<a href="https://www.scichart.com/wp-content/uploads/2016/06/Performance-report-Sun-Apr-24-14_30_50.xlsx-Excel-2016-06-21-19.22.08.png" rel="prettyphoto"><img class="alignnone wp-image-12981 size-large" src="https://www.scichart.com/wp-content/uploads/2016/06/Performance-report-Sun-Apr-24-14_30_50.xlsx-Excel-2016-06-21-19.22.08-1024x716.png" alt="Performance report Sun Apr 24 14_30_50.xlsx - Excel 2016-06-21 19.22.08" width="1024" height="716" /></a>
<h2>Test Results in Chart Form</h2>
What Android charting performance comparison would be complete without the results in chart form?

You can find the test results plotted below:
<h4>Append Points Test Results</h4>
<em>SciChart Android is green, results are FPS (Refresh rate) so higher is better.</em>

<a href="https://www.scichart.com/wp-content/uploads/2016/06/AppendPerformance.png" rel="prettyphoto"><img class="alignnone wp-image-12995 size-large" src="https://www.scichart.com/wp-content/uploads/2016/06/AppendPerformance-1024x679.png" alt="AppendPerformance" width="1024" height="679" /></a>
<h4>Fifo Scrolling Test Results</h4>
<em>SciChart Android is green, results are FPS (Refresh rate) so higher is better.</em>

<a href="https://www.scichart.com/wp-content/uploads/2016/06/FifoPerformance.png" rel="prettyphoto"><img class="alignnone wp-image-12996 size-large" src="https://www.scichart.com/wp-content/uploads/2016/06/FifoPerformance-1024x621.png" alt="FifoPerformance" width="1024" height="621" /></a>
<h4>Scatter Series Test Results</h4>
<em>SciChart Android is green, results are FPS (Refresh rate) so higher is better.</em>

<a href="https://www.scichart.com/wp-content/uploads/2016/06/ScatterPerformance.png" rel="prettyphoto"><img class="alignnone wp-image-12998 size-large" src="https://www.scichart.com/wp-content/uploads/2016/06/ScatterPerformance-1024x569.png" alt="ScatterPerformance" width="1024" height="569" /></a>
<h4>NxM Series Test Results</h4>
<em>SciChart Android is green, results are FPS (Refresh rate) so higher is better.</em>

<a href="https://www.scichart.com/wp-content/uploads/2016/06/NxMPerformance.png" rel="prettyphoto"><img class="alignnone wp-image-12997" src="https://www.scichart.com/wp-content/uploads/2016/06/NxMPerformance.png" alt="NxMPerformance" width="1024" height="682" /></a>

&nbsp;
<h2>Performance Comparison Conclusions</h2>
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 <a href="https://www.scichart.com/android-chart-features/">Android Charts by SciChart</a> 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.

&nbsp;

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 <a href="https://www.scichart.com/contact-us/">contact us</a>. For legal reasons we can't publish the names of <em>CompetitorA</em> 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