From 64fb865f7a04b904d712ffeaf329efd28d2ac740 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 1 Aug 2008 15:13:14 +0000 Subject: [PATCH] More profiling points for Linker::link(). And that's enough work on it for the moment. --- includes/Linker.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/Linker.php b/includes/Linker.php index 8255e1a275..29e51cdf84 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -182,6 +182,7 @@ class Linker { } # If we don't know whether the page exists, let's find out. + wfProfileIn( __METHOD__ . '-checkPageExistence' ); if( !in_array( 'known', $options ) and !in_array( 'broken', $options ) ) { if( $target->getNamespace() == NS_SPECIAL ) { if( SpecialPage::exists( $target->getDbKey() ) ) { @@ -194,10 +195,10 @@ class Linker { or $target->exists() ) { $options []= 'known'; } else { - # Either it exists $options []= 'broken'; } } + wfProfileOut( __METHOD__ . '-checkPageExistence' ); # Note: we want the href attribute first, for prettiness. $attribs = array( 'href' => $this->linkUrl( $target, $query, $options ) ); @@ -218,16 +219,20 @@ class Linker { } private function linkUrl( $target, $query, $options ) { + wfProfileIn( __METHOD__ ); # If it's a broken link, add the appropriate query pieces, unless # there's already an action specified. if( in_array( 'broken', $options ) and empty( $query['action'] ) ) { $query['action'] = 'edit'; $query['redlink'] = '1'; } - return $target->getLinkUrl( $query ); + $ret = $target->getLinkUrl( $query ); + wfProfileOut( __METHOD__ ); + return $ret; } private function linkAttribs( $target, $attribs, $options ) { + wfProfileIn( __METHOD__ ); global $wgUser; $defaults = array(); @@ -276,6 +281,7 @@ class Linker { $ret[$key] = $val; } } + wfProfileOut( __METHOD__ ); return $ret; } -- 2.20.1