http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88640
Revision: 88640
Author: demon
Date: 2011-05-23 14:29:06 +0000 (Mon, 23 May 2011)
Log Message:
-----------
MFT r88402: profiling
Modified Paths:
--------------
branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/FeedSMItem.php
branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php
branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/SitemapFeed.php
Property Changed:
----------------
branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/
Property changes on: branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/REL1_15/phase3/extensions/GoogleNewsSitemap:51646
/branches/new-installer/phase3/extensions/GoogleNewsSitemap:43664-66004
/branches/sqlite/extensions/GoogleNewsSitemap:58211-58321
/branches/wmf/1.16wmf4/extensions/GoogleNewsSitemap:67177,69199,76243,77266
/branches/wmf-deployment/extensions/GoogleNewsSitemap:60970
/trunk/extensions/GoogleNewsSitemap:87153,87157,87236,87458
/trunk/phase3/extensions/GoogleNewsSitemap:79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,80406,81833,83212,83590
+ /branches/REL1_15/phase3/extensions/GoogleNewsSitemap:51646
/branches/new-installer/phase3/extensions/GoogleNewsSitemap:43664-66004
/branches/sqlite/extensions/GoogleNewsSitemap:58211-58321
/branches/wmf/1.16wmf4/extensions/GoogleNewsSitemap:67177,69199,76243,77266
/branches/wmf-deployment/extensions/GoogleNewsSitemap:60970
/trunk/extensions/GoogleNewsSitemap:87153,87157,87236,87458,88402
/trunk/phase3/extensions/GoogleNewsSitemap:79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,80406,81833,83212,83590
Modified: branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/FeedSMItem.php
===================================================================
--- branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/FeedSMItem.php
2011-05-23 14:09:15 UTC (rev 88639)
+++ branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/FeedSMItem.php
2011-05-23 14:29:06 UTC (rev 88640)
@@ -89,6 +89,7 @@
* @return String
*/
public function getDescription() {
+ wfProfileIn( __METHOD__ );
// This is probably rather inefficient to do for several pages
// but not much worse than the rest of this extension.
$req = new FauxRequest( array(
@@ -99,13 +100,14 @@
$main = new ApiMain( $req );
$main->execute();
$data = $main->getResultData();
+ $result = '';
if ( isset( $data['parse']['text']['*'] ) ) {
- return $this->xmlEncode(
+ $result = $this->xmlEncode(
$data['parse']['text']['*']
);
- } else {
- return '';
}
+ wfProfileOut( __METHOD__ );
+ return $result;
}
}
Modified:
branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php
===================================================================
---
branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php
2011-05-23 14:09:15 UTC (rev 88639)
+++
branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php
2011-05-23 14:29:06 UTC (rev 88640)
@@ -86,6 +86,7 @@
echo $cached;
echo "<!-- From cache: $cacheKey -->";
} else {
+ wfProfileIn( __METHOD__ . '-not-cached' );
$res = $this->getCategories( $params, $categories,
$notCategories );
ob_start();
$this->makeFeed( $feed, $res );
@@ -96,6 +97,7 @@
array( $cacheInvalidationInfo, $output ),
$this->maxCacheTime
);
+ wfProfileOut( __METHOD__ . '-not-cached' );
}
}
@@ -195,6 +197,7 @@
* @return String All the above info concatenated.
*/
private function getCacheInvalidationInfo ( $params, $categories,
$notCategories ) {
+ wfProfileIn( __METHOD__ );
$dbr = wfGetDB( DB_SLAVE );
$cacheInfo = '';
$categoriesKey = array();
@@ -253,6 +256,7 @@
$cacheInfo .= $ts . '!';
}
+ wfProfileOut( __METHOD__ );
return $cacheInfo;
}
/**
@@ -497,6 +501,7 @@
* @return Array of String: list of keywords
*/
public function getKeywords ( $title ) {
+ wfProfileIn( __METHOD__ );
$cats = $title->getParentCategories();
$res = array();
@@ -537,6 +542,7 @@
}
}
}
+ wfProfileOut( __METHOD__ );
return $res;
}
}
Modified: branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/SitemapFeed.php
===================================================================
--- branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/SitemapFeed.php
2011-05-23 14:09:15 UTC (rev 88639)
+++ branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/SitemapFeed.php
2011-05-23 14:29:06 UTC (rev 88640)
@@ -61,6 +61,8 @@
if ( !( $item instanceof FeedItem ) ) {
throw new MWException( "Requires a FeedItem or
subclass." );
}
+
+ wfProfileIn( __METHOD__ );
if ( !( $item instanceof FeedSMItem ) ) {
$item = FeedSMItem::newFromFeedItem( $item );
}
@@ -103,6 +105,7 @@
$this->writer->endElement();
}
$this->writer->endElement(); // end url
+ wfProfileOut( __METHOD__ );
}
/**
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs