]> matita.cs.unibo.it Git - helm.git/blob - helm/matita/scripts/public_html/bench.php
fix
[helm.git] / helm / matita / scripts / public_html / bench.php
1 <?php require("common.php"); 
2   
3 // syntax
4 //
5 // queries ::= query | query "###" queries
6 // query ::= name "@@@" sql
7 //
8 $limits = array("30","50","-1");
9   
10 print_r($limits);
11
12 $quey_all = urlencode("Whole content:@@@select * from bench");
13 $query_fail = urlencode(
14   "Number of failures:@@@" .
15   "select mark, count(distinct test) as fail_no from bench where result = 'fail' group by mark order by mark desc"
16   . "###" . 
17   "Tests failed:@@@" .
18   "select distinct mark, test, result from bench where result = 'fail' order by mark desc" 
19 );
20 $query_gc = urlencode(
21   "GC usage @@@" .
22   "select bench.mark, SEC_TO_TIME(SUM(TIME_TO_SEC(bench.time)) - SUM(TIME_TO_SEC(bench1.time))) as gc_hoverhead from bench, bench as bench1 where bench.mark = bench1.mark and bench.test = bench1.test and bench.options = 'gc-on' and bench1.options = 'gc-off' and bench.compilation = bench1.compilation group by mark"
23   . "###" . 
24   "GC usage (opt)@@@" .
25   "select bench.mark, SEC_TO_TIME(SUM(TIME_TO_SEC(bench.time)) - SUM(TIME_TO_SEC(bench1.time))) as gc_hoverhead from bench, bench as bench1 where bench.mark = bench1.mark and bench.test = bench1.test and bench.options = 'gc-on' and bench1.options = 'gc-off' and bench.compilation = bench1.compilation and bench.compilation = 'opt' group by mark"
26   . "###" . 
27   "GC usage (byte)@@@" .
28   "select bench.mark, SEC_TO_TIME(SUM(TIME_TO_SEC(bench.time)) - SUM(TIME_TO_SEC(bench1.time))) as gc_hoverhead from bench, bench as bench1 where bench.mark = bench1.mark and bench.test = bench1.test and bench.options = 'gc-on' and bench1.options = 'gc-off' and bench.compilation = bench1.compilation and bench.compilation = 'byte' group by mark"
29   
30 );
31 $query_auto = urlencode(
32   "Auto (with GC):@@@select mark, SEC_TO_TIME(SUM(TIME_TO_SEC(bench.time))) as time from bench where test='auto.ma' and options = 'gc-on' group by mark order by mark desc"
33   . "###" . 
34   "Auto (without GC):@@@select mark, SEC_TO_TIME(SUM(TIME_TO_SEC(bench.time))) as time from bench where test='auto.ma' and options = 'gc-off' group by mark order by mark desc"
35   #  . "###" . 
36   # "GC overhead@@@select bench.mark, SEC_TO_TIME(SUM(TIME_TO_SEC(bench.time)) - SUM(TIME_TO_SEC(bench1.time))) as gc_hoverhead from bench, bench as bench1 where bench.mark = bench1.mark and bench.test = bench1.test and bench.options = 'gc-on' and bench1.options = 'gc-off' and bench.compilation = bench1.compilation and bench.test = 'auto.ma' group by mark"
37 );
38
39 $query_csc = urlencode("Performances (byte and GC) per mark@@@select mark, SEC_TO_TIME(SUM(TIME_TO_SEC(time))) as sum_time, SEC_TO_TIME(SUM(TIME_TO_SEC(timeuser))) as sum_timeuser from bench where options = 'gc-on' and compilation = 'byte'group by mark order by mark desc"
40 );
41
42 $query_csc_opt = urlencode("Performances (opt and GC) per mark@@@select mark, SEC_TO_TIME(SUM(TIME_TO_SEC(time))) as sum_time, SEC_TO_TIME(SUM(TIME_TO_SEC(timeuser))) as sum_timeuser from bench where options = 'gc-on' and compilation = 'opt'group by mark order by mark desc"
43 );
44
45 $query_total = urlencode("Number of compiled tests@@@select mark, COUNT(DISTINCT test) as N from bench group by mark order by mark desc"
46 #  . "###" .
47 #"Lost tests"
48 );
49
50 function minus1_to_all($s){
51   if ($s = "-1") 
52     return "all";
53   else 
54     return $s;
55 }
56
57 function links_of($name,$q){
58   echo "<li>$name";
59   foreach($limits as $l) {
60     echo "<a href=\"showquery.php?query=$q LIMIT 0,$l; \">" . 
61           minus1_to_all($l) . "</a>&nbsp;";
62   }
63   echo "</li>";
64 }
65
66 ?>
67
68 <html>
69   <head>
70   <link type="text/css" rel="stylesheet" href="style.css"/>
71   </head>
72   <body>
73     <h1>QUERY the benchmark system</h1>
74     <h2>Common Queries</h2>
75     <p>
76       <ul>
77       <? links_of("Broken tests",$query_fail) ?>
78       <? links_of("Garbage collector killer",$query_gc) ?>
79       <? links_of("Auto performances",$query_auto) ?>
80       <? links_of("Global performances (bytecode)",$query_csc) ?>
81       <? links_of("Global performances (nativecode)",$query_csc_opt) ?>
82       <? links_of("Number of compiled tests",$query_total) ?>
83       <? links_of("All table contents",$quey_all) ?>
84       </ul>
85     </p>
86     <h2>Custom Query</h2>
87     <form action="composequery.php" method="get">
88     <table>
89   <tr>
90     <td>Marks:</td>
91     <td> 
92       <? array_to_combo("mark",
93             query("select distinct mark from bench order by mark desc;")); ?>
94     </td>
95   </tr>
96   <tr>
97     <td>Compilations:</td>
98     <td> 
99       <? array_to_combo("compilation",
100            query("select distinct compilation from bench;")); ?>
101     </td>
102   </tr>
103   <tr>
104     <td>Options:</td>
105     <td>  
106       <?array_to_combo("options",query("select distinct options from bench;"));?>
107     </td>
108   </tr>
109   <tr>
110     <td>Tests:</td>
111     <td>    
112       <? array_to_combo("test",query("select distinct test from bench;")); ?>
113     </td>
114   </tr>
115   <tr>
116     <td>Test results:</td>
117     <td>
118       <? array_to_combo("result",query("select distinct result from bench;")); ?>
119     </td>
120   </tr>
121   <tr>
122     <td>Group By: </td>
123     <td>
124       <? array_to_combo("groupby",array(array("mark","options"))); ?>
125     </td>
126   </tr>
127   <tr>
128     <td>Limit: </td>
129     <td>
130       <? array_to_combo("limit",array($limits)); ?>
131     </td>
132   </tr>
133   <tr>
134     <td><input type="submit" value="Submit"/></td>
135   </tr>
136  </table>
137 </form>
138 </body>
139 </html>