actually draw the graph
[dygraphs.git] / tests / perf.html
1 <html>
2 <head>
3 <title>perf</title>
4 <!--[if IE]>
5 <script type="text/javascript" src="excanvas.js"></script>
6 <![endif]-->
7 <script type="text/javascript" src="../dygraph-combined.js"></script>
8 <script type="text/javascript" src="../dygraph-canvas.js"></script>
9 <script type="text/javascript" src="../dygraph.js"></script>
10 <script type="text/javascript" src="data.js"></script>
11 </head>
12 <body>
13 <div id="div_g" style="width:600px; height:300px;"></div>
14 <div id="status"></div>
15
16 <script type="text/javascript">
17 var num_tests = 100;
18 var times = [];
19 var start = new Date;
20
21 for (var i = 0; i < num_tests; i++) {
22 var this_start = new Date;
23 g = new Dygraph(
24 document.getElementById("div_g"),
25 NoisyData, {
26 rollPeriod: 7,
27 errorBars: true
28 }
29 );
30 var this_end = new Date;
31 times.push([i, this_end - this_start]);
32 }
33
34 var end = new Date;
35
36 document.getElementById("status").innerHTML = "Elapsed time: " + (end - start)/num_tests + " ms/instantiation";
37 new Dygraph(
38 document.getElementById("div_g"),
39 times, {
40 labels: [ "Iteration", "Time (ms)" ]
41 }
42 );
43 </script>
44
45 <p><b>Some numbers on a MacBook Pro 2.53 GHz Core 2 Duo</b><br/>
46 commit bb5899c56e33716db724cb60a5120b91f5fccdeb<br/>
47 Firefox 3.0.15: 28 ms/instantiation<br/>
48 Safari 4.0.3: 15.02 ms/instantiation<Br/>
49 <br/>
50
51 commit 2847c1cf1a2874e9fe56b5749e6e105e37bb086a<br/>
52 Firefox 3.0.15: 49.27 ms/instantiation<br/>
53 Safari 4.0.3: 24.48 ms/instantiation<br/>
54 </p>
55 </body>
56 </html>