-
Notifications
You must be signed in to change notification settings - Fork 606
/
perf.html
62 lines (56 loc) · 1.93 KB
/
perf.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>perf</title>
<link rel="stylesheet" type="text/css" href="../dist/dygraph.css" />
<link rel="stylesheet" type="text/css" href="../common/vextlnk.css" />
<script type="text/javascript" src="../dist/dygraph.js"></script>
<script type="text/javascript" src="data.js"></script>
</head>
<body>
<div id="div_g" style="width:600px; height:300px;"></div>
<div id="status"></div>
<script type="text/javascript"><!--//--><![CDATA[//><!--
Dygraph.onDOMready(function onDOMready() {
var num_tests = 250;
var times = [];
var start = new Date;
for (var i = 0; i < num_tests; i++) {
var this_start = new Date;
// Calling destroy() here reduces the memory usage in Chrome by
// ~1.2MB/instantiation.
if (i) g.destroy();
g = new Dygraph(
document.getElementById("div_g"),
NoisyData, {
rollPeriod: 7,
errorBars: true
}
);
var this_end = new Date;
times.push([i, this_end - this_start]);
}
var end = new Date;
document.getElementById("status").innerHTML = "Elapsed time: " + (end - start)/num_tests + " ms/instantiation";
perf = new Dygraph(
document.getElementById("div_g"),
times, {
labels: [ "Iteration", "Time (ms)" ]
}
);
});
//--><!]]></script>
<p><b>Some numbers on a MacBook Pro 2.53 GHz Core 2 Duo</b><br />
<table border="1"><tbody>
<tr><td>commit</td><td>Firefox 3.0.15</td><td>Safari 4.0.3</td></tr>
<tr><td>bb5899c56e33716db724cb60a5120b91f5fccdeb</td>
<td>28 ms/instantiation</td>
<td>15.02 ms/instantiation</td></tr>
<tr><td>2847c1cf1a2874e9fe56b5749e6e105e37bb086a</td>
<td>49.27 ms/instantiation</td>
<td>24.48 ms/instantiation</td></tr>
</tbody></table>
</p>
</body>
</html>