X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Fdygraph-many-points-benchmark.html;h=e276e06a1f9bf7e84141f09753f809edc37b7e70;hb=da2a028fc41e5573868358b3d9eda9826211d217;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..e276e06 100644 --- a/tests/dygraph-many-points-benchmark.html +++ b/tests/dygraph-many-points-benchmark.html @@ -1,16 +1,9 @@
- +Timestamps: - aligned - unaligned
+ aligned + unaligned + +x-axis type: + numeric + date/time +
Number of points per series (points):
Number of series (series):
@@ -49,12 +45,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 +61,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 +88,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 +97,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 +106,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 +119,7 @@
}
avg/=millisecondss.length;
document.getElementById('message').innerHTML =
- "Durations: " + millisecondss + " Average: " + avg;
+ "Durations: " + millisecondss + "
Average: " + avg;
}
if (durations.length > 0) {
@@ -155,7 +155,7 @@
series: 1,
rollPeriod: 1,
repetitions: 1,
- type: 'sine',
+ type: 'sine'
};
// Parse the URL for parameters. Use it to override the values hash.