X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Fdygraph-many-points-benchmark.html;h=5b94eb387acc4d6f957c969bde83502366851567;hb=6eef8c1b9ec7b247ee2b508032bd3ec957d0fb68;hp=09c89a6ad0b16d30ca016e0a84fc9cb597f03ff2;hpb=0a14b0f9fbe3e97e0163b4e6ad7893e49d3bf2ff;p=dygraphs.git diff --git a/tests/dygraph-many-points-benchmark.html b/tests/dygraph-many-points-benchmark.html index 09c89a6..5b94eb3 100644 --- a/tests/dygraph-many-points-benchmark.html +++ b/tests/dygraph-many-points-benchmark.html @@ -1,16 +1,12 @@ - Benchmarking for Plots with Many Points - - + @@ -23,10 +19,13 @@ random points

Timestamps: - aligned - unaligned

+ aligned + unaligned +

+

x-axis type: + numeric + date/time +

Number of points per series (points):

Number of series (series): @@ -49,12 +48,14 @@ var metrics = null; var dataType = "sine"; var timestamps = "aligned"; + var numRuns = 0; var durations = []; updatePlot = function() { document.getElementById('message').innerHTML = ""; var plotDiv = document.getElementById('plot'); plotDiv.innerHTML = 'Redrawing...'; + var numeric = document.getElementById('numeric').checked; var numPoints = parseInt(document.getElementById('points').value); var numSeries = @@ -63,8 +64,8 @@ parseInt(document.getElementById('repetitions').value); var data = []; - var xmin = 0.0; - var xmax = 2.0 * Math.PI; + var xmin = numeric ? 0.0 : Date.parse("2014/01/01"); + var xmax = numeric ? 2.0 * Math.PI : Date.parse("2014/12/31"); var adj = .5; var delta = (xmax - xmin) / (numPoints - 1); var unalignmentDelta = delta / numSeries; @@ -90,6 +91,7 @@ data[i*numSeries + j] = elemCopy; } } + if (!numeric) data[i][0] = new Date(data[i][0]); } var labels = [ "x" ]; for (var j = 0; j < numSeries; j++) { @@ -98,6 +100,7 @@ var rollPeriod = parseInt( document.getElementById('rollPeriod').value); var opts = {labels: labels, rollPeriod: rollPeriod, timingName: "x"}; + opts['fillGraph'] = document.getElementById('fill').checked; var millisecondss = []; for (var i = 0; i < repetitions; i++) { if (graph != null) { @@ -106,7 +109,7 @@ var start = new Date(); graph = new Dygraph(plotDiv, data, opts); var end = new Date(); - durations.push([start, end - start]); + durations.push([numRuns++, end - start]); millisecondss.push(end - start); } if (repetitions == 1) { @@ -119,7 +122,7 @@ } avg/=millisecondss.length; document.getElementById('message').innerHTML = - "Durations: " + millisecondss + " Average: " + avg; + "Durations: " + millisecondss + "
Average: " + avg; } if (durations.length > 0) { @@ -155,7 +158,7 @@ series: 1, rollPeriod: 1, repetitions: 1, - type: 'sine', + type: 'sine' }; // Parse the URL for parameters. Use it to override the values hash.