1 <?php require("common.php");
5 // queries ::= query | query "###" queries
6 // query ::= name "@@@" sql
8 $limits = array("20","50","100");
10 $quey_all = urlencode("
13 select * from bench order by mark desc***");
15 $query_fail = urlencode("
19 mark, count(distinct test) as fail_no
21 where result = 'fail' group by mark order by mark desc***
25 select distinct mark, test, result
27 where result = 'fail' order by mark desc***");
29 $query_gc = urlencode("
33 bench.mark, SUM(bench.time) - SUM(bench1.time) as gc_hoverhead
34 from bench, bench as bench1
36 bench.mark = bench1.mark and
37 bench.test = bench1.test and
38 bench.options = 'gc-on' and
39 bench1.options = 'gc-off' and
40 bench.compilation = bench1.compilation
46 bench.mark, SUM(bench.time) - SUM(bench1.time) as gc_hoverhead
47 from bench, bench as bench1
49 bench.mark = bench1.mark and
50 bench.test = bench1.test and
51 bench.options = 'gc-on' and
52 bench1.options = 'gc-off' and
53 bench.compilation = bench1.compilation and
54 bench.compilation = 'opt'
60 bench.mark, SUM(bench.time) - SUM(bench1.time) as gc_hoverhead
61 from bench, bench as bench1
63 bench.mark = bench1.mark and
64 bench.test = bench1.test and
65 bench.options = 'gc-on' and
66 bench1.options = 'gc-off' and
67 bench.compilation = bench1.compilation and
68 bench.compilation = 'byte'
71 $query_auto = urlencode("
75 mark, SUM(bench.time) as time
79 test='auto.ma' and options = 'gc-on'
86 mark, SUM(bench.time) as time
90 test='auto.ma' and options = 'gc-off'
98 bench.mark, SUM(bench.time) - SUM(bench1.time) as gc_hoverhead
100 bench, bench as bench1
102 bench.mark = bench1.mark and
103 bench.test = bench1.test and
104 bench.options = 'gc-on' and
105 bench1.options = 'gc-off' and
106 bench.compilation = bench1.compilation and
107 bench.test = 'auto.ma'
111 $query_csc = urlencode("
112 Performances (byte and GC) per mark
116 bench_svn.revision as revision,
117 SUM(bench.time) as sum_time,
118 SUM(bench.timeuser) as sum_timeuser,
119 COUNT(DISTINCT bench.test) as performed_tests,
120 COUNT(DISTINCT bench1.test) as failed_tests
122 bench, bench_svn,bench as bench1
124 bench.options = 'gc-on' and
125 bench.compilation = 'byte' and
126 bench_svn.mark = bench.mark and
127 bench1.result = 'fail' and
128 bench1.mark = bench.mark and
129 bench1.compilation = 'byte' and
130 bench1.options = 'gc-on'
132 order by bench.mark desc
135 $query_csc_opt = urlencode("
136 Performances (opt and GC) per mark
140 bench_svn.revision as revision,
141 SUM(bench.time) as sum_time,
142 SUM(bench.timeuser) as sum_timeuser,
143 COUNT(DISTINCT bench.test) as performed_tests,
144 COUNT(DISTINCT bench1.test) as failed_tests
146 bench, bench_svn,bench as bench1
148 bench.options = 'gc-on' and
149 bench.compilation = 'opt' and
150 bench_svn.mark = bench.mark and
151 bench1.result = 'fail' and
152 bench1.mark = bench.mark and
153 bench1.compilation = 'opt' and
154 bench1.options = 'gc-on'
156 order by bench.mark desc
159 $query_total = urlencode("
163 COUNT(DISTINCT test) as MAX
170 Number of compiled tests
174 COUNT(DISTINCT test) as N
181 function minus1_to_all($s){
188 function links_of($name,$q,$limits){
189 echo "<li>$name : ";
190 if (strpos($q, urlencode("***")) === false) {
191 echo "<a href=\"showquery.php?query=$q;\">all</a>";
193 foreach($limits as $l) {
194 $q1 = str_replace(urlencode("***"), " LIMIT 0,$l", $q);
195 echo "<a href=\"showquery.php?query=$q1;\">" .
196 minus1_to_all($l) . "</a> ";
198 $q1 = str_replace(urlencode("***"), " ", $q);
199 echo "<a href=\"showquery.php?query=$q1;\">" .
200 minus1_to_all("-1") . "</a> ";
209 <link type="text/css" rel="stylesheet" href="style.css"/>
212 <h1>QUERY the benchmark system</h1>
213 <h2>Common Queries</h2>
216 <? links_of("Broken tests",$query_fail,$limits) ?>
217 <? links_of("Garbage collector killer",$query_gc,$limits) ?>
218 <? links_of("Auto performances",$query_auto,$limits) ?>
219 <? links_of("Global performances (bytecode)",$query_csc,$limits) ?>
220 <? links_of("Global performances (nativecode)",$query_csc_opt,$limits) ?>
221 <? links_of("Number of compiled tests",$query_total,$limits) ?>
222 <? links_of("All table contents",$quey_all,$limits) ?>
225 <h2>Custom Query - Simple Interface</h2>
226 <form action="composequery.php" method="get">
231 <select name="mark">";
232 <option value="--">--</option>";
233 <?query("select distinct mark from bench order by mark desc;",
239 <td>Compilations:</td>
241 <select name="compilation">";
242 <option value="--">--</option>";
243 <?query("select distinct compilation from bench;","array_to_combo");?>
250 <select name="options">";
251 <option value="--">--</option>";
252 <?query("select distinct options from bench;","array_to_combo");?>
259 <select name="test">";
260 <option value="--">--</option>";
261 <?query("select distinct test from bench;","array_to_combo");?>
266 <td>Test results:</td>
268 <select name="result">";
269 <option value="--">--</option>";
270 <?query("select distinct result from bench;","array_to_combo"); ?>
277 <select name="groupby">";
278 <option value="--">--</option>";
279 <? array_to_combo(array("mark"));array_to_combo(array("options")); ?>
286 <select name="limit">";
287 <option value="--">--</option>";
288 <? foreach(array($limits) as $l) {array_to_combo($l);} ?>
293 <td><input type="submit" value="Submit" class="button" /></td>
297 <h2>Custom Query - raw SQL</h2>
298 <form action="showquery.php" method="get">
300 <tr><td>'bench' table description:</td></tr>
302 <? query("describe bench","printer"); ?>
306 SQL (only one query, ';' if present must terminate the query, no characters allowed after it):</td></tr>
308 <textarea rows="10" cols="120" name="query"/>
310 b1.test as test, b1.timeuser as oldtime, b2.timeuser as newtime, b1.compilation as comp, b1.options as opts
312 bench as b1, bench as b2
314 b1.test = b2.test and
315 b1.options = b2.options and
316 b1.compilation = b2.compilation and
317 b1.mark = '' and b2.mark= '' and
318 ABS(b1.timeuser - b2.timeuser) > 100;</textarea>
322 <input type="submit" value="Submit" class="button" /></td>