projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clean up alignment
[dygraphs.git]
/
tests
/
dygraph-many-points-benchmark.html
diff --git
a/tests/dygraph-many-points-benchmark.html
b/tests/dygraph-many-points-benchmark.html
index
2919706
..
4cf7ef5
100644
(file)
--- a/
tests/dygraph-many-points-benchmark.html
+++ b/
tests/dygraph-many-points-benchmark.html
@@
-16,6
+16,9
@@
<body>
<p>Plot which can be easily generated with different numbers of points for
benchmarking/profiling and improving performance of dygraphs.</p>
<body>
<p>Plot which can be easily generated with different numbers of points for
benchmarking/profiling and improving performance of dygraphs.</p>
+ <p>Data to plot:
+ <input type="radio" name="plot_group1" value="sine" onclick="clickedRadioButton(this);" checked> sinusoid function
+ <input type="radio" name="plot_group1" value="rand" onclick="clickedRadioButton(this);"> random points <br></p>
<p>Number of points:
<input type="text" id="num_points_input" size="20"></p>
<p>Number of series:
<p>Number of points:
<input type="text" id="num_points_input" size="20"></p>
<p>Number of series:
@@
-35,6
+38,7
@@
<script type="text/javascript">
var plot;
<script type="text/javascript">
var plot;
+ var dataType = "sine";
var durations = [];
updatePlot = function() {
var durations = [];
updatePlot = function() {
@@
-58,14
+62,19
@@
var x = xmin + delta * i;
var elem = [ x ];
for (var j = 0; j < numSeries; j++) {
var x = xmin + delta * i;
var elem = [ x ];
for (var j = 0; j < numSeries; j++) {
- var y = Math.sin(x + (j * adj));
+ var y;
+ if (dataType == "rand") {
+ y = Math.pow(Math.random() - Math.random(), 7);
+ } else {
+ y = Math.sin(x + (j * adj));
+ }
elem.push(y);
}
data[i] = elem;
}
var labels = [ "x" ];
for (var j = 0; j < numSeries; j++) {
elem.push(y);
}
data[i] = elem;
}
var labels = [ "x" ];
for (var j = 0; j < numSeries; j++) {
- labels.push("
sin(x + " + (j*adj) + ")"
);
+ labels.push("
data-set-" + j
);
}
var rollPeriod = parseInt(
document.getElementById('roll_period_input').value);
}
var rollPeriod = parseInt(
document.getElementById('roll_period_input').value);
@@
-82,8
+91,13
@@
document.getElementById('message').innerHTML =
"completed in " + (end - start) + " milliseconds.";
} else {
document.getElementById('message').innerHTML =
"completed in " + (end - start) + " milliseconds.";
} else {
+ var avg = 0;
+ for (var i = 0; i < millisecondss.length; i++) {
+ avg+=millisecondss[i];
+ }
+ avg/=millisecondss.length;
document.getElementById('message').innerHTML =
document.getElementById('message').innerHTML =
- "Durations: " + millisecondss;
+ "Durations: " + millisecondss
+ " Average: " + avg
;
}
if (durations.length > 0) {
}
if (durations.length > 0) {
@@
-100,6
+114,11
@@
"completed in " + (end2 - start2) + " milliseconds.";
}
};
"completed in " + (end2 - start2) + " milliseconds.";
}
};
+
+ clickedRadioButton = function(radiobutton) {
+ dataType = radiobutton.value;
+ };
+
document.getElementById('num_points_input').value = '100';
document.getElementById('num_series_input').value = '1';
document.getElementById('num_points_input').value = '100';
document.getElementById('num_series_input').value = '1';