From: Tim Starling Date: Wed, 26 May 2004 12:30:36 +0000 (+0000) Subject: Fixed profiling X-Git-Tag: 1.5.0alpha1~3203 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=1a5b4b700060a99903c3787b64b91bf9deb788a2;p=lhc%2Fweb%2Fwiklou.git Fixed profiling --- diff --git a/includes/Parser.php b/includes/Parser.php index 4404e7d6d3..3a4b666a1d 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -994,6 +994,7 @@ class Parser $trail = $m[3]; } else { # Invalid form; output directly $s .= $prefix . "[[" . $line ; + wfProfileOut( $fname ); return $s; } @@ -1032,6 +1033,7 @@ class Parser $nt = Title::newFromText( $link ); if( !$nt ) { $s .= $prefix . "[[" . $line; + wfProfileOut( $fname ); return $s; } $ns = $nt->getNamespace(); @@ -1040,11 +1042,13 @@ class Parser if( $iw && $this->mOptions->getInterwikiMagic() && $nottalk && $wgLang->getLanguageName( $iw ) ) { array_push( $this->mOutput->mLanguageLinks, $nt->getPrefixedText() ); $s .= $prefix . $trail ; + wfProfileOut( $fname ); return (trim($s) == '')? '': $s; } if( $ns == $image ) { $s .= $prefix . $sk->makeImageLinkObj( $nt, $text ) . $trail; $wgLinkCache->addImageLinkObj( $nt ); + wfProfileOut( $fname ); return $s; } if ( $ns == $category ) { @@ -1059,6 +1063,7 @@ class Parser $wgLinkCache->addCategoryLinkObj( $nt, $sortkey ); $this->mOutput->mCategoryLinks[] = $t ; $s .= $prefix . $trail ; + wfProfileOut( $fname ); return $s ; } } @@ -1066,15 +1071,18 @@ class Parser ( strpos( $link, "#" ) == FALSE ) ) { # Self-links are handled specially; generally de-link and change to bold. $s .= $prefix . $sk->makeSelfLinkObj( $nt, $text, "", $trail ); + wfProfileOut( $fname ); return $s; } if( $ns == $media ) { $s .= $prefix . $sk->makeMediaLinkObj( $nt, $text ) . $trail; $wgLinkCache->addImageLinkObj( $nt ); + wfProfileOut( $fname ); return $s; } elseif( $ns == $special ) { $s .= $prefix . $sk->makeKnownLinkObj( $nt, $text, "", $trail ); + wfProfileOut( $fname ); return $s; } $s .= $sk->makeLinkObj( $nt, $text, "", $trail , $prefix ); @@ -1394,6 +1402,7 @@ class Parser array_pop( $this->mArgStack ); + wfProfileOut( $fname ); return $text; } diff --git a/includes/Profiling.php b/includes/Profiling.php index 392ca38f12..ed58bf08d8 100755 --- a/includes/Profiling.php +++ b/includes/Profiling.php @@ -82,6 +82,7 @@ class Profiler if( !count( $this->mStack ) ) { return "No profiling output\n"; } + $this->close(); $width = 125; $format = "%-" . ($width - 28) . "s %6d %6.3f %6.3f %6.3f%%\n"; $titleFormat = "%-" . ($width - 28) . "s %9s %9s %9s %9s\n"; @@ -173,5 +174,4 @@ class Profiler $wgProfiler = new Profiler(); $wgProfiler->profileIn( "-total" ); - ?>