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