X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Fdygraph-many-points-benchmark.html;h=3dfe4bbf37fd3470a163023166b6460b9541215e;hb=3f50dabbb12935605812184bfdd4a1485b1b9530;hp=17dadcd5c9140da6eee6877c698f6981fc98fb0e;hpb=375adb8f6d9f71808efb237246f732d10038eedc;p=dygraphs.git
diff --git a/tests/dygraph-many-points-benchmark.html b/tests/dygraph-many-points-benchmark.html
index 17dadcd..3dfe4bb 100644
--- a/tests/dygraph-many-points-benchmark.html
+++ b/tests/dygraph-many-points-benchmark.html
@@ -23,10 +23,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 +52,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 +68,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 +95,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 +104,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 +113,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 +126,7 @@
}
avg/=millisecondss.length;
document.getElementById('message').innerHTML =
- "Durations: " + millisecondss + " Average: " + avg;
+ "Durations: " + millisecondss + "
Average: " + avg;
}
if (durations.length > 0) {