mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-20 18:09:54 +00:00
benchs: add per algo chip averages
This commit is contained in:
parent
a94c239b53
commit
d99bc61b5c
5 changed files with 148 additions and 6 deletions
|
@ -40,4 +40,15 @@ class BenchController extends CommonController
|
|||
$this->render('devices');
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
public function actionAlgo()
|
||||
{
|
||||
$algo = substr(getparam('algo'), 0, 32);
|
||||
if (!empty($algo))
|
||||
$this->render('algo', array('algo'=>$algo));
|
||||
else
|
||||
$this->goback();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
118
web/yaamp/modules/bench/algo.php
Normal file
118
web/yaamp/modules/bench/algo.php
Normal file
|
@ -0,0 +1,118 @@
|
|||
<?php
|
||||
|
||||
include('functions.php');
|
||||
|
||||
if (empty($algo)) $algo = 'all';
|
||||
$algoFilter = $algo != 'all' ? ' AND B.algo='.sqlQuote($algo) : '';
|
||||
|
||||
$this->pageTitle = "Algo benchmarks";
|
||||
|
||||
// -------------------------------------------------
|
||||
$algos = array();
|
||||
$in_db = dbolist("SELECT algo, count(id) as count FROM benchmarks B GROUP BY algo ORDER BY algo ASC, count DESC");
|
||||
foreach ($in_db as $row) {
|
||||
$algos[$row['algo']] = $row['count'];
|
||||
}
|
||||
$options = '<option value="all">Show all</option>';
|
||||
foreach($algos as $a => $count) {
|
||||
if($a == $algo)
|
||||
$options .= '<option value="'.$a.'" selected="selected">'.$a.'</option>';
|
||||
else
|
||||
$options .= '<option value="'.$a.'">'.$a.'</option>';
|
||||
}
|
||||
// -------------------------------------------------
|
||||
|
||||
$in_db = dbolist("SELECT B.type, B.idchip, C.chip,
|
||||
AVG(B.khps) as khps, AVG(B.power) as power, AVG(B.intensity) as intensity, AVG(B.freq) as freq
|
||||
FROM benchmarks B
|
||||
LEFT JOIN bench_chips C ON C.id = B.idchip
|
||||
WHERE B.idchip > 0 $algoFilter
|
||||
GROUP BY B.type, B.idchip ORDER BY khps DESC
|
||||
");
|
||||
|
||||
echo <<<end
|
||||
<div align="right" style="margin-bottom: 2px; margin-right: 0px;">
|
||||
<input class="search" type="search" data-column="all" style="width: 140px;" placeholder="Search..." />
|
||||
</div>
|
||||
|
||||
<style type="text/css">
|
||||
tr.ssrow.filtered { display: none; }
|
||||
td.tick { font-weight: bolder; }
|
||||
span.generic { color: gray; }
|
||||
.page .footer { width: auto; };
|
||||
</style>
|
||||
|
||||
<div align="right" style="margin-top: -22px; margin-right: 140px;">
|
||||
Select Algo: <select class="filter" id="algo_select">{$options}</select>
|
||||
</div>
|
||||
|
||||
<p style="margin-top: -20px; margin-bottom: 4px; line-height: 22px; font-weight: bolder;">
|
||||
Overall $algo performance
|
||||
</p>
|
||||
end;
|
||||
|
||||
JavascriptFile("/yaamp/ui/js/jquery.metadata.js");
|
||||
JavascriptFile("/yaamp/ui/js/jquery.tablesorter.widgets.js");
|
||||
|
||||
showTableSorter('maintable', "{
|
||||
tableClass: 'dataGrid',
|
||||
widgets: ['zebra','filter'],
|
||||
textExtraction: {
|
||||
2: function(node, table, n) { return $(node).attr('data'); }
|
||||
},
|
||||
widgetOptions: {
|
||||
filter_external: '.search',
|
||||
filter_columnFilters: false,
|
||||
filter_childRows : true,
|
||||
filter_ignoreCase: true
|
||||
}
|
||||
}");
|
||||
|
||||
echo <<<END
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-sorter="text" width="50">Type</th>
|
||||
<th data-sorter="text" width="70">Chip</th>
|
||||
<th data-sorter="numeric" width="220">Hashrate</th>
|
||||
<th data-sorter="numeric" width="220">Power</th>
|
||||
<th data-sorter="numeric" width="220">Int</th>
|
||||
<th data-sorter="numeric" width="220">Freq</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
END;
|
||||
|
||||
foreach ($in_db as $row) {
|
||||
echo '<tr class="ssrow">';
|
||||
|
||||
echo '<td>'.strtoupper($row['type']).'</td>';
|
||||
$power = dboscalar('SELECT AVG(power) FROM benchmarks B WHERE idchip='.$row['idchip'].$algoFilter.' AND power > 10');
|
||||
|
||||
$chip = CHtml::link($row['chip'], '/bench?chip='.$row['idchip'].'&algo='.$algo);
|
||||
echo '<td>'.$chip.'</td>';
|
||||
|
||||
echo '<td data="'.$row['khps'].'">'.Itoa2(1000*round($row['khps'],3),3).'H</td>';
|
||||
echo '<td>'.($power>0 ? round($power) : '-').'</td>';
|
||||
echo '<td>'.($row['intensity']>0 ? round($row['intensity']) : '-').'</td>';
|
||||
echo '<td>'.($row['freq']>0 ? round($row['freq']) : '-').'</td>';
|
||||
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '</tbody></table><br/>';
|
||||
|
||||
echo '<a href="/bench/devices">Show current state of the database (devices/algos)</a><br/>';
|
||||
echo '<a href="/site/benchmarks">Learn how to submit your results</a>';
|
||||
echo '<br/><br/>';
|
||||
|
||||
echo <<<end
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$('select.filter').change(function(event) {
|
||||
algo = jQuery('#algo_select').val();
|
||||
window.location.href = '/bench/algo?algo='+algo;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
end;
|
|
@ -4,20 +4,20 @@ include('functions.php');
|
|||
|
||||
$this->pageTitle = "Devices";
|
||||
|
||||
$devices = array();
|
||||
$in_db = dbolist("SELECT DISTINCT device, type, chip, vendorid FROM benchmarks ORDER BY type DESC, device, vendorid");
|
||||
$chips = array();
|
||||
$in_db = dbolist("SELECT DISTINCT device, type, chip, idchip, vendorid FROM benchmarks WHERE idchip > 0 ORDER BY type DESC, device, vendorid");
|
||||
foreach ($in_db as $key => $row) {
|
||||
$vendorid = $row['vendorid'];
|
||||
$chip = $row['chip'];
|
||||
if (empty($chip)) $chip = getChipName($row);
|
||||
|
||||
if (!empty($vendorid)) $devices[$vendorid] = $chip;
|
||||
if (!empty($vendorid)) $chips[$vendorid] = $chip;
|
||||
}
|
||||
|
||||
$chip = 'all';
|
||||
|
||||
$options = '<option value="all">Show all</option>';
|
||||
foreach($devices as $a => $count) {
|
||||
foreach($chips as $a => $count) {
|
||||
if($a == $chip)
|
||||
$options .= '<option value="'.$a.'" selected="selected">'.$a.'</option>';
|
||||
else
|
||||
|
@ -80,7 +80,11 @@ foreach ($in_db as $row) {
|
|||
|
||||
$vendorid = $row['vendorid'];
|
||||
|
||||
echo '<td>'.arraySafeVal($devices, $vendorid, '-').'</td>';
|
||||
$chip = arraySafeVal($chips, $vendorid, '-');
|
||||
if (!empty($row['idchip'])) {
|
||||
$chip = CHtml::link($chip, '/bench?chip='.$row['idchip'].'&algo=all');
|
||||
}
|
||||
echo '<td>'.$chip.'</td>';
|
||||
|
||||
if ($row['type'] == 'gpu')
|
||||
echo '<td>'.$row['device'].getProductIdSuffix($row).'</td>';
|
||||
|
@ -99,7 +103,11 @@ foreach ($in_db as $row) {
|
|||
foreach ($algos as $algo) {
|
||||
$tick = ' ';
|
||||
if (in_array($algo, $records)) {
|
||||
$tick = CHtml::link('✓','/bench?algo='.$algo);
|
||||
$url = '/bench?algo='.$algo;
|
||||
if (!empty($row['idchip'])) {
|
||||
$url .= '&chip='.$row['idchip'];
|
||||
}
|
||||
$tick = CHtml::link('✓', $url);
|
||||
}
|
||||
echo '<td class="tick">'.$tick.'</td>';
|
||||
}
|
||||
|
|
|
@ -14,12 +14,16 @@ function getProductIdSuffix($row)
|
|||
'1458:3649' => 'Black',
|
||||
// Gigabyte 960
|
||||
'1458:36ae' => '4GB',
|
||||
// Gigabyte 1080
|
||||
'1458:3702' => 'G1',
|
||||
// MSI 960
|
||||
'1462:3202' => 'Gaming 2G',
|
||||
// MSI 970
|
||||
'1462:3160' => 'Gaming',
|
||||
// MSI 980
|
||||
'1462:3170' => 'Gaming',
|
||||
// MSI 1080
|
||||
'1462:3362' => 'Gaming',
|
||||
// EVGA 740
|
||||
'3842:2744' => 'SC DDR3',
|
||||
// EVGA 750 Ti
|
||||
|
|
|
@ -77,6 +77,7 @@ if ($algo == 'all') {
|
|||
echo "Last 50 results";
|
||||
} else {
|
||||
echo "Last 50 $algo results";
|
||||
echo ", ".CHtml::link(" show totals", '/bench/algo?algo='.$algo);
|
||||
}
|
||||
echo '</p>';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue