https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114477

Revision: 114477
Author:   preilly
Date:     2012-03-24 19:44:07 +0000 (Sat, 24 Mar 2012)
Log Message:
-----------
1.19wmf: MFG Following a performance regression reported on wikitech-l, added 
merciless profiling to ExtMobileFrontend::DOMParse() Change-Id: 
I9287783b2406b7ccfa06c724de112f21988aebe2

Modified Paths:
--------------
    branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php

Modified: 
branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php
===================================================================
--- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php     
2012-03-24 12:13:20 UTC (rev 114476)
+++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php     
2012-03-24 19:44:07 UTC (rev 114477)
@@ -945,10 +945,13 @@
                global $wgScript;
                wfProfileIn( __METHOD__ );
 
+               wfProfileIn( __METHOD__ . '-formatter-init' );
                $formatter = new MobileFormatter( $html, self::$title, 
$this->contentFormat, $this->wmlContext );
                $formatter->useMessages( self::$messages );
                $doc = $formatter->getDoc();
+               wfProfileOut( __METHOD__ . '-formatter-init' );
 
+               wfProfileIn( __METHOD__ . '-zero' );
                $zeroRatedBannerElement = $doc->getElementById( 
'zero-rated-banner' );
 
                if ( !$zeroRatedBannerElement ) {
@@ -958,7 +961,9 @@
                if ( $zeroRatedBannerElement ) {
                        self::$zeroRatedBanner = $doc->saveXML( 
$zeroRatedBannerElement, LIBXML_NOEMPTYTAG );
                }
+               wfProfileOut( __METHOD__ . '-zero' );
 
+               wfProfileIn( __METHOD__ . '-beta' );
                if ( self::$isBetaGroupMember ) {
                        $ptLogout = $doc->getElementById( 'pt-logout' );
 
@@ -1002,11 +1007,15 @@
                                }
                        }
                }
+               wfProfileOut( __METHOD__ . '-beta' );
 
+               wfProfileIn( __METHOD__ . '-filter' );
                $formatter->removeImages( self::$disableImages == 1 );
                $formatter->whitelistIds( 'zero-language-search' );
                $formatter->filterContent();
+               wfProfileOut( __METHOD__ . '-filter' );
 
+               wfProfileIn( __METHOD__ . '-userlogin' );
                if ( self::$title->isSpecial( 'Userlogin' ) && 
self::$isBetaGroupMember ) {
                        if ( $userlogin && get_class( $userlogin ) === 
'DOMElement' ) {
                                $login = $this->renderLogin();
@@ -1014,7 +1023,9 @@
                                $userlogin->appendChild( $loginNode );
                        }
                }
+               wfProfileOut( __METHOD__ . '-userlogin' );
 
+               wfProfileIn( __METHOD__ . '-getText' );
                $formatter->setIsMainPage( self::$isMainPage );
                $prepend = '';
                if ( $this->contentFormat == 'XHTML'
@@ -1024,9 +1035,11 @@
                        $formatter->enableExpandableSections();
                }
                $contentHtml = $formatter->getText( 'content' );
+               wfProfileOut( __METHOD__ . '-getText' );
 
                $htmlTitle = htmlspecialchars( self::$htmlTitle );
 
+               wfProfileIn( __METHOD__ . '-templates' );
                if ( $this->contentFormat == 'WML' ) {
                        header( 'Content-Type: text/vnd.wap.wml' );
 
@@ -1084,8 +1097,10 @@
                        $applicationTemplate->setByArray( $options );
                        $applicationHtml = $applicationTemplate->getHTML();
                }
+               wfProfileOut( __METHOD__ . '-templates' );
 
                if ( self::$format === 'json' ) {
+                       wfProfileIn( __METHOD__ . '-json' );
                        header( 'Content-Type: application/javascript' );
                        header( 'Content-Disposition: attachment; 
filename="data.js";' );
                        $json_data = array();
@@ -1097,6 +1112,7 @@
                        if ( !empty( self::$callback ) ) {
                                $json = urlencode( htmlspecialchars( 
self::$callback ) ) . '(' . $json . ')';
                        }
+                       wfProfileOut( __METHOD__ . '-json' );
 
                        wfProfileOut( __METHOD__ );
                        return $json;


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to