picking up the page load times a bit
This commit is contained in:
@@ -311,6 +311,7 @@ function localize_item(&$item){
|
||||
if(!function_exists('conversation')) {
|
||||
function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
|
||||
|
||||
$tstart = dba_timer();
|
||||
|
||||
require_once('bbcode.php');
|
||||
|
||||
@@ -522,6 +523,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
|
||||
|
||||
$comments = array();
|
||||
foreach($items as $item) {
|
||||
|
||||
|
||||
if((intval($item['gravity']) == 6) && ($item['id'] != $item['parent'])) {
|
||||
if(! x($comments,$item['parent']))
|
||||
$comments[$item['parent']] = 1;
|
||||
@@ -549,6 +552,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
|
||||
|
||||
foreach($items as $item) {
|
||||
|
||||
$tfirst = dba_timer();
|
||||
|
||||
$comment = '';
|
||||
$template = $tpl;
|
||||
$commentww = '';
|
||||
@@ -872,8 +877,21 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
|
||||
call_hooks('display_item', $arr);
|
||||
|
||||
$threads[$threadsid]['items'][] = $arr['output'];
|
||||
|
||||
$tlast = dba_timer();
|
||||
|
||||
// logger('render dba_timer: item# ' . $item['id'] . ' ' . sprintf('%01.4f',$tlast - $tfirst));
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// logger('render total dba_timer: ' . sprintf('%01.4f',$tlast - $tstart));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// logger('threads: ' . count($threads) . ' update: ' . $update);
|
||||
@@ -907,6 +925,10 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
|
||||
));
|
||||
}
|
||||
|
||||
$tfinal = dba_timer();
|
||||
// logger('render template dba_timer: ' . sprintf('%01.4f',$tfinal - $tlast));
|
||||
|
||||
|
||||
return $o;
|
||||
}}
|
||||
|
||||
|
||||
@@ -189,6 +189,7 @@
|
||||
}
|
||||
|
||||
public function replace($s, $r) {
|
||||
// $t1 = dba_timer();
|
||||
$this->r = $r;
|
||||
|
||||
$s = $this->_build_nodes($s);
|
||||
@@ -199,12 +200,17 @@
|
||||
// remove comments block
|
||||
$s = preg_replace('/{#[^#]*#}/', "" , $s);
|
||||
|
||||
// $t2 = dba_timer();
|
||||
|
||||
// replace strings recursively (limit to 10 loops)
|
||||
$os = ""; $count=0;
|
||||
while($os!=$s && $count<10){
|
||||
$os=$s; $count++;
|
||||
$s = $this->var_replace($s);
|
||||
}
|
||||
// $t3 = dba_timer();
|
||||
// logger('macro timer: ' . sprintf('%01.4f %01.4f',$t3 - $t2, $t2 - $t1));
|
||||
|
||||
return $s;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user