Highcharts update vs new chart (v4)

Revision 4 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/prototype/1/prototype.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/mootools/1.3/mootools-yui-compressed.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/yui/2.9.0/build/yuiloader/yuiloader-min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1/dojo/dojo.xd.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//code.highcharts.com/highcharts.js"></script>
<script src="//code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="height: 400px"></div>

Setup

var a = [1, 2, 3, 4, 5, 6, 7, 8];
    var b = [8, 7, 6, 5, 4, 3, 2, 1];
    var options = {
      chart: {
        renderTo: 'container',
      },
      series: [{
        name: 'A',
        data: a
      }, {
        name: 'B',
        data: b
      }]
    };
    var chart;

Teardown


    chart.destroy();
  

Test runner

Ready to run.

Testing in
TestOps/sec
new chart
chart = new Highcharts.Chart(options);
chart.destroy();
options.series[0].data = b;
options.series[1].data = a;
chart = new Highcharts.Chart(options);
ready
update
chart = new Highcharts.Chart(options);
chart.series[0].setData(b);
chart.series[1].setData(a);
chart.redraw();
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.