Add Profiling to trunk from r93681
authorSam Reed <reedy@users.mediawiki.org>
Mon, 1 Aug 2011 23:28:16 +0000 (23:28 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 1 Aug 2011 23:28:16 +0000 (23:28 +0000)
includes/Article.php

index 9bf3f05..db7faac 100644 (file)
@@ -1860,6 +1860,7 @@ class Article extends Page {
                global $wgEnableParserCache, $wgUser;
                $user = is_null( $user ) ? $wgUser : $user;
 
+               wfProfileIn( __METHOD__ );
                // Should the parser cache be used?
                $useParserCache = $wgEnableParserCache &&
                        $user->getStubThreshold() == 0 &&
@@ -1875,6 +1876,7 @@ class Article extends Page {
                if ( $useParserCache ) {
                        $parserOutput = ParserCache::singleton()->get( $this, $this->mPage->getParserOptions() );
                        if ( $parserOutput !== false ) {
+                               wfProfileOut( __METHOD__ );
                                return $parserOutput;
                        }
                }
@@ -1890,6 +1892,7 @@ class Article extends Page {
                        $text = $rev->getText();
                }
 
+               wfProfileOut( __METHOD__ );
                return $this->getOutputFromWikitext( $text, $useParserCache );
        }