use dygraphs to plot perf vs. iteration
authorDan Vanderkam <danvdk@gmail.com>
Thu, 3 Dec 2009 16:17:08 +0000 (08:17 -0800)
committerDan Vanderkam <danvdk@gmail.com>
Thu, 3 Dec 2009 16:17:08 +0000 (08:17 -0800)
tests/perf.html

index a5567be..1ed85c7 100644 (file)
 
     <script type="text/javascript">
       var num_tests = 100;
+      var times = [];
       var start = new Date;
 
       for (var i = 0; i < num_tests; i++) {
+        var this_start = new Date;
         g = new Dygraph(
               document.getElementById("g"),
               NoisyData, {
                 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";
+      new Dygraph(
+        document.getElementById("g"),
+        times, {
+          labels: [ "Iteration", "Time (ms)" ]
+        }
+        );
     </script>
 
     <p><b>Some numbers on a MacBook Pro 2.53 GHz Core 2 Duo</b><br/>