From: Tim Starling Date: Mon, 16 Oct 2006 03:16:12 +0000 (+0000) Subject: profiling X-Git-Tag: 1.31.0-rc.0~55469 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=135dfa0e6319a857239e46829716b44031032973;p=lhc%2Fweb%2Fwiklou.git profiling --- diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index 6cb1ad950a..ddfeface25 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -197,9 +197,15 @@ class LanguageConverter { if( !$this->mTablesLoaded ) $this->loadTables(); if ( $this->mUseFss ) { - return fss_exec_replace( $this->mFssObjects[$variant], $text ); + wfProfileIn( __METHOD__.'-fss' ); + $text = fss_exec_replace( $this->mFssObjects[$variant], $text ); + wfProfileOut( __METHOD__.'-fss' ); + return $text; } else { - return strtr( $text, $this->mTables[$variant] ); + wfProfileIn( __METHOD__.'-strtr' ); + $text = strtr( $text, $this->mTables[$variant] ); + wfProfileOut( __METHOD__.'-strtr' ); + return $text; } } @@ -543,12 +549,16 @@ class LanguageConverter { global $wgMemc; if( $this->mTablesLoaded ) return; + wfProfileIn( __METHOD__ ); $this->mTablesLoaded = true; $this->mTables = false; if($fromcache) { + wfProfileIn( __METHOD__.'-cache' ); $this->mTables = $wgMemc->get( $this->mCacheKey ); + wfProfileOut( __METHOD__.'-cache' ); } if ( !$this->mTables ) { + wfProfileOut( __METHOD__.'-recache' ); // not in cache, or we need a fresh reload. // we will first load the default tables // then update them using things in MediaWiki:Zhconversiontable/* @@ -565,10 +575,14 @@ class LanguageConverter { $wgMemc->set($this->mCacheKey, $this->mTables, 43200); $this->unlockCache(); } + wfProfileOut( __METHOD__.'-recache' ); } if ( $this->mUseFss ) { + wfProfileIn( __METHOD__.'-fss' ); $this->generateFssObjects(); + wfProfileOut( __METHOD__.'-fss' ); } + wfProfileOut( __METHOD__ ); } /**