diff --git a/web/yaamp/modules/bench/BenchController.php b/web/yaamp/modules/bench/BenchController.php index 3397cae..aeeb8c8 100644 --- a/web/yaamp/modules/bench/BenchController.php +++ b/web/yaamp/modules/bench/BenchController.php @@ -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(); + } + } diff --git a/web/yaamp/modules/bench/algo.php b/web/yaamp/modules/bench/algo.php new file mode 100644 index 0000000..f92b46a --- /dev/null +++ b/web/yaamp/modules/bench/algo.php @@ -0,0 +1,118 @@ +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 = ''; +foreach($algos as $a => $count) { + if($a == $algo) + $options .= ''; + else + $options .= ''; +} +// ------------------------------------------------- + +$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 << + + + + + +
+Select Algo:   +
+ +

+Overall $algo performance +

+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 << + +Type +Chip +Hashrate +Power +Int +Freq + + +END; + +foreach ($in_db as $row) { + echo ''; + + echo ''.strtoupper($row['type']).''; + $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 ''.$chip.''; + + echo ''.Itoa2(1000*round($row['khps'],3),3).'H'; + echo ''.($power>0 ? round($power) : '-').''; + echo ''.($row['intensity']>0 ? round($row['intensity']) : '-').''; + echo ''.($row['freq']>0 ? round($row['freq']) : '-').''; + + echo ''; +} + +echo '
'; + +echo 'Show current state of the database (devices/algos)
'; +echo 'Learn how to submit your results'; +echo '

'; + +echo << + +$('select.filter').change(function(event) { + algo = jQuery('#algo_select').val(); + window.location.href = '/bench/algo?algo='+algo; +}); + + + +end; diff --git a/web/yaamp/modules/bench/devices.php b/web/yaamp/modules/bench/devices.php index 7e37c21..443f22c 100644 --- a/web/yaamp/modules/bench/devices.php +++ b/web/yaamp/modules/bench/devices.php @@ -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 = ''; -foreach($devices as $a => $count) { +foreach($chips as $a => $count) { if($a == $chip) $options .= ''; else @@ -80,7 +80,11 @@ foreach ($in_db as $row) { $vendorid = $row['vendorid']; - echo ''.arraySafeVal($devices, $vendorid, '-').''; + $chip = arraySafeVal($chips, $vendorid, '-'); + if (!empty($row['idchip'])) { + $chip = CHtml::link($chip, '/bench?chip='.$row['idchip'].'&algo=all'); + } + echo ''.$chip.''; if ($row['type'] == 'gpu') echo ''.$row['device'].getProductIdSuffix($row).''; @@ -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 ''.$tick.''; } diff --git a/web/yaamp/modules/bench/functions.php b/web/yaamp/modules/bench/functions.php index 93f589b..8ba98fa 100644 --- a/web/yaamp/modules/bench/functions.php +++ b/web/yaamp/modules/bench/functions.php @@ -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 diff --git a/web/yaamp/modules/bench/index.php b/web/yaamp/modules/bench/index.php index 0ea0753..77d9c8e 100644 --- a/web/yaamp/modules/bench/index.php +++ b/web/yaamp/modules/bench/index.php @@ -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 '

';