Hoo man has submitted this change and it was merged.

Change subject: Remove obvious function-level profiling
......................................................................


Remove obvious function-level profiling

There's a few sub-functional wfProfile* calls left, those should
be assessed for removal or conversion into 1.25+ profiling calls

Change-Id: If8874b17a00ff1d61bc74dcbc4c8d62419ba914e
---
M client/WikibaseClient.hooks.php
M client/includes/Changes/ChangeHandler.php
M client/includes/Changes/ChangeRunCoalescer.php
M client/includes/Changes/WikiPageUpdater.php
M client/includes/DataAccess/PropertyParserFunction/Runner.php
M client/includes/Hooks/ParserAfterParseHookHandler.php
M client/includes/Hooks/SidebarHookHandlers.php
M client/includes/Hooks/UpdateRepoHookHandlers.php
M client/includes/InterwikiSorter.php
M client/includes/LangLinkHandler.php
M client/includes/UpdateRepo/UpdateRepo.php
M lib/includes/ChangeNotificationJob.php
M lib/includes/ChangesTable.php
M lib/includes/LanguageFallbackChainFactory.php
M lib/includes/store/CachingEntityRevisionLookup.php
M lib/includes/store/TermPropertyLabelResolver.php
M lib/includes/store/sql/PropertyInfoTable.php
M lib/includes/store/sql/SiteLinkTable.php
M lib/includes/store/sql/SqlEntityInfoBuilder.php
M lib/includes/store/sql/TermSqlIndex.php
M lib/includes/store/sql/WikiPageEntityRevisionLookup.php
M lib/maintenance/dispatchChanges.php
M repo/Wikibase.hooks.php
M repo/includes/BabelUserLanguageLookup.php
M repo/includes/EditEntity.php
M repo/includes/EntityParserOutputGenerator.php
M repo/includes/Hooks/LinkBeginHookHandler.php
M repo/includes/Interactors/RedirectCreationInteractor.php
M repo/includes/LinkedData/EntityDataSerializationService.php
M repo/includes/Notifications/ChangeNotifier.php
M repo/includes/UpdateRepo/UpdateRepoJob.php
M repo/includes/UpdateRepo/UpdateRepoOnDeleteJob.php
M repo/includes/UpdateRepo/UpdateRepoOnMoveJob.php
M repo/includes/Validators/SiteLinkUniquenessValidator.php
M repo/includes/View/ClaimHtmlGenerator.php
M repo/includes/View/EntityTermsView.php
M repo/includes/View/EntityView.php
M repo/includes/View/PropertyView.php
M repo/includes/View/SectionEditLinkGenerator.php
M repo/includes/actions/SubmitEntityAction.php
M repo/includes/api/ApiWikibase.php
M repo/includes/api/CreateClaim.php
M repo/includes/api/CreateRedirectModule.php
M repo/includes/api/EditEntity.php
M repo/includes/api/GetClaims.php
M repo/includes/api/GetEntities.php
M repo/includes/api/LinkTitles.php
M repo/includes/api/MergeItems.php
M repo/includes/api/ModifyEntity.php
M repo/includes/api/RemoveClaims.php
M repo/includes/api/RemoveQualifiers.php
M repo/includes/api/RemoveReferences.php
M repo/includes/api/SearchEntities.php
M repo/includes/api/SetAliases.php
M repo/includes/api/SetClaimValue.php
M repo/includes/api/SetDescription.php
M repo/includes/api/SetLabel.php
M repo/includes/api/SetQualifier.php
M repo/includes/api/SetReference.php
M repo/includes/api/SetSiteLink.php
M repo/includes/content/EntityContent.php
M repo/includes/content/EntityContentFactory.php
M repo/includes/content/ItemContent.php
M repo/includes/store/sql/WikiPageEntityStore.php
64 files changed, 23 insertions(+), 655 deletions(-)

Approvals:
  Hoo man: Verified; Looks good to me, approved



diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index 1df92f4..9c332c6 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -89,8 +89,6 @@
         * @return bool
         */
        public static function onWikibaseDeleteData( $reportMessage ) {
-               wfProfileIn( __METHOD__ );
-
                $store = WikibaseClient::getDefaultInstance()->getStore();
 
                $reportMessage( "Deleting data from the " . get_class( $store ) 
. " store..." );
@@ -107,7 +105,6 @@
 
                $reportMessage( "done!\n" );
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -123,8 +120,6 @@
         * @return bool
         */
        public static function onWikibaseRebuildData( $reportMessage ) {
-               wfProfileIn( __METHOD__ );
-
                $store = WikibaseClient::getDefaultInstance()->getStore();
                $reportMessage( "Rebuilding all data in the " . get_class( 
$store )
                        . " store on the client..." );
@@ -141,7 +136,6 @@
                ChangeHandler::singleton()->handleChanges( iterator_to_array( 
$changes ) );
                $reportMessage( "done!\n" );
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -218,15 +212,12 @@
        public static function onSpecialRecentChangesQuery( array &$conds, 
array &$tables,
                array &$join_conds, FormOptions $opts, array &$query_options, 
array &$fields
        ) {
-               wfProfileIn( __METHOD__ );
-
                $rcFilterOpts = new RecentChangesFilterOptions( $opts );
 
                if ( $rcFilterOpts->showWikibaseEdits() === false ) {
                        $conds[] = 'rc_type != ' . RC_EXTERNAL;
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -245,8 +236,6 @@
         */
        public static function onOldChangesListRecentChangesLine( ChangesList 
&$changesList, &$s,
                RecentChange $rc, &$classes = array() ) {
-
-               wfProfileIn( __METHOD__ );
 
                $type = $rc->getAttribute( 'rc_type' );
 
@@ -283,7 +272,6 @@
                // OutputPage will ignore multiple calls
                $changesList->getOutput()->addModuleStyles( 
'wikibase.client.changeslist.css' );
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -404,15 +392,11 @@
         * @return bool
         */
        public static function onBeforePageDisplay( OutputPage &$out, Skin 
&$skin ) {
-               wfProfileIn( __METHOD__ );
-
                $namespaceChecker = 
WikibaseClient::getDefaultInstance()->getNamespaceChecker();
                $beforePageDisplayHandler = new BeforePageDisplayHandler( 
$namespaceChecker );
 
                $actionName = Action::getActionName( $skin->getContext() );
                $beforePageDisplayHandler->addModules( $out, $actionName );
-
-               wfProfileOut( __METHOD__ );
 
                return true;
        }
@@ -435,8 +419,6 @@
                        // shorten out
                        return true;
                }
-
-               wfProfileIn( __METHOD__ );
 
                $repoLinker = $wikibaseClient->newRepoLinker();
                $entityIdParser = $wikibaseClient->getEntityIdParser();
@@ -476,7 +458,6 @@
                        $template->set( 'language_urls', array() );
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
diff --git a/client/includes/Changes/ChangeHandler.php 
b/client/includes/Changes/ChangeHandler.php
index 5eac54b..4bc65bc 100644
--- a/client/includes/Changes/ChangeHandler.php
+++ b/client/includes/Changes/ChangeHandler.php
@@ -125,12 +125,9 @@
         * @param Change[] $changes
         */
        public function handleChanges( array $changes ) {
-               wfProfileIn( __METHOD__ );
-
                $changes = $this->changeListTransformer->transformChangeList( 
$changes );
 
                if ( !wfRunHooks( 'WikibaseHandleChanges', array( $changes ) ) 
) {
-                       wfProfileOut( __METHOD__ );
                        return;
                }
 
@@ -141,8 +138,6 @@
 
                        $this->handleChange( $change );
                }
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -158,8 +153,6 @@
         * @return bool
         */
        public function handleChange( Change $change ) {
-               wfProfileIn( __METHOD__ );
-
                $changeId = $this->getChangeIdForLog( $change );
                wfDebugLog( __CLASS__, __FUNCTION__ . ": handling change 
#$changeId"
                        . ' (' . $change->getType() . ')' );
@@ -169,7 +162,6 @@
                if ( empty( $usagesPerPage ) ) {
                        // nothing to do
                        wfDebugLog( __CLASS__, __FUNCTION__ . ": No pages to 
update for change #$changeId." );
-                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
@@ -188,7 +180,6 @@
                        $this->applyUpdateAction( $action, $bucket, $change );
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -198,8 +189,6 @@
         * @return string[] A list of actions, as defined by the 
self::XXXX_ACTION constants.
         */
        public function getUpdateActions( $aspects ) {
-               wfProfileIn( __METHOD__ );
-
                $actions = array();
                $aspects = array_flip( $aspects );
 
@@ -253,8 +242,6 @@
         * @param EntityChange $change
         */
        private function applyUpdateAction( $action, array $pageIds, 
EntityChange $change ) {
-               wfProfileIn( __METHOD__ );
-
                $titlesToUpdate = $this->getTitlesForPageIds( $pageIds );
 
                switch ( $action ) {
@@ -287,8 +274,6 @@
                        //TODO: handling for self::HISTORY_ENTRY_ACTION goes 
here.
                        //      should probably be 
$this->updater->injectHistoryRecords() or some such.
                }
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -341,12 +326,9 @@
         *         or false if the change does not provide edit meta data
         */
        private function getRCAttributes( EntityChange $change ) {
-               wfProfileIn( __METHOD__ );
-
                $rcinfo = $change->getMetadata();
 
                if ( !is_array( $rcinfo ) ) {
-                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
@@ -370,12 +352,9 @@
 
                $rcinfo = array_merge( $fields, $rcinfo );
 
-               $params = array(
+               return array(
                        'wikibase-repo-change' => array_merge( $fields, $rcinfo 
)
                );
-
-               wfProfileOut( __METHOD__ );
-               return $params;
        }
 
        /**
diff --git a/client/includes/Changes/ChangeRunCoalescer.php 
b/client/includes/Changes/ChangeRunCoalescer.php
index 76974e3..f5f9e11 100644
--- a/client/includes/Changes/ChangeRunCoalescer.php
+++ b/client/includes/Changes/ChangeRunCoalescer.php
@@ -62,7 +62,6 @@
         * @return Change[]
         */
        public function transformChangeList( array $changes ) {
-               wfProfileIn( __METHOD__ );
                $coalesced = array();
 
                $changesByEntity = $this->groupChangesByEntity( $changes );
@@ -76,7 +75,6 @@
                wfDebugLog( __CLASS__, __METHOD__ . ': coalesced '
                        . count( $changes ) . ' into ' . count( $coalesced ) . 
' changes' );
 
-               wfProfileOut( __METHOD__ );
                return $coalesced;
        }
 
@@ -89,7 +87,6 @@
         *         entity ID is the list of changes performed on that entity.
         */
        private function groupChangesByEntity( array $changes ) {
-               wfProfileIn( __METHOD__ );
                $groups = array();
 
                foreach ( $changes as $change ) {
@@ -102,7 +99,6 @@
                        $groups[$id][] = $change;
                }
 
-               wfProfileOut( __METHOD__ );
                return $groups;
        }
 
@@ -125,8 +121,6 @@
                } elseif ( count( $changes ) === 1 )  {
                        return reset( $changes );
                }
-
-               wfProfileIn( __METHOD__ );
 
                // we now assume that we have a list if EntityChanges,
                // all done by the same user on the same entity.
@@ -198,7 +192,6 @@
                $info['changes'] = $changes;
                $change->setField( 'info', $info );
 
-               wfProfileOut( __METHOD__ );
                return $change;
        }
 
@@ -215,8 +208,6 @@
         * @return EntityChange[] grouped changes
         */
        private function coalesceRuns( array $changes ) {
-               wfProfileIn( __METHOD__ );
-
                $coalesced = array();
 
                $currentRun = array();
@@ -287,7 +278,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $coalesced;
        }
 
diff --git a/client/includes/Changes/WikiPageUpdater.php 
b/client/includes/Changes/WikiPageUpdater.php
index 468bcad..8c60b05 100644
--- a/client/includes/Changes/WikiPageUpdater.php
+++ b/client/includes/Changes/WikiPageUpdater.php
@@ -84,8 +84,6 @@
         * @param array $attribs
         */
        public function injectRCRecords( array $titles, array $attribs ) {
-               wfProfileIn( __METHOD__ );
-
                foreach ( $titles as $title ) {
                        if ( !$title->exists() ) {
                                continue;
@@ -96,8 +94,5 @@
                        wfDebugLog( __CLASS__, __FUNCTION__ . ": saving RC 
entry for " . $title->getFullText() );
                        $rc->save();
                }
-
-               wfProfileOut( __METHOD__ );
        }
-
 }
diff --git a/client/includes/DataAccess/PropertyParserFunction/Runner.php 
b/client/includes/DataAccess/PropertyParserFunction/Runner.php
index 1779af9..d025e37 100644
--- a/client/includes/DataAccess/PropertyParserFunction/Runner.php
+++ b/client/includes/DataAccess/PropertyParserFunction/Runner.php
@@ -59,15 +59,12 @@
         * @return string Wikitext
         */
        public function runPropertyParserFunction( Parser $parser, 
$propertyLabelOrId ) {
-               wfProfileIn( __METHOD__ );
-
                // @todo use id provided as argument, if arbitrary access 
allowed,
                // which means property ids might also be allowed here.
                $entityId = $this->getItemIdForConnectedPage( $parser );
 
                // @todo handle when site link is not there, such as site link 
/ entity has been deleted...
                if ( $entityId === null ) {
-                       wfProfileOut( __METHOD__ );
                        return '';
                }
 
@@ -79,7 +76,6 @@
                $usageAcc = new ParserOutputUsageAccumulator( 
$parser->getOutput() );
                $usageAcc->addOtherUsage( $entityId );
 
-               wfProfileOut( __METHOD__ );
                return $result;
        }
 
@@ -120,13 +116,7 @@
         * @return array
         */
        public static function render( Parser $parser, $propertyLabelOrId ) {
-               wfProfileIn( __METHOD__ );
-
                $runner = 
WikibaseClient::getDefaultInstance()->getPropertyParserFunctionRunner();
-               $result = $runner->runPropertyParserFunction( $parser, 
$propertyLabelOrId );
-
-               wfProfileOut( __METHOD__ );
-               return $result;
+               return $runner->runPropertyParserFunction( $parser, 
$propertyLabelOrId );
        }
-
 }
diff --git a/client/includes/Hooks/ParserAfterParseHookHandler.php 
b/client/includes/Hooks/ParserAfterParseHookHandler.php
index 526037d..3923cdd 100644
--- a/client/includes/Hooks/ParserAfterParseHookHandler.php
+++ b/client/includes/Hooks/ParserAfterParseHookHandler.php
@@ -126,8 +126,6 @@
                        return true;
                }
 
-               wfProfileIn( __METHOD__ );
-
                // @todo split up the multiple responsibilities here and in 
lang link handler
 
                $parserOutput = $parser->getOutput();
@@ -151,7 +149,6 @@
                        $parserOutput->setLanguageLinks( $sortedLinks );
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
diff --git a/client/includes/Hooks/SidebarHookHandlers.php 
b/client/includes/Hooks/SidebarHookHandlers.php
index fec9054..7e82a8d 100644
--- a/client/includes/Hooks/SidebarHookHandlers.php
+++ b/client/includes/Hooks/SidebarHookHandlers.php
@@ -205,11 +205,8 @@
                        return true;
                }
 
-               wfProfileIn( __METHOD__ );
-
                $this->badgeDisplay->applyBadges( $languageLink, 
$languageLinkTitle, $output );
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
diff --git a/client/includes/Hooks/UpdateRepoHookHandlers.php 
b/client/includes/Hooks/UpdateRepoHookHandlers.php
index 3627ad2..ec41526 100644
--- a/client/includes/Hooks/UpdateRepoHookHandlers.php
+++ b/client/includes/Hooks/UpdateRepoHookHandlers.php
@@ -72,7 +72,6 @@
 
                if ( !$jobQueueGroup ) {
                        wfLogWarning( "Failed to acquire a JobQueueGroup for 
$repoDB" );
-                       wfProfileOut( __METHOD__ );
                        return true;
                }
 
diff --git a/client/includes/InterwikiSorter.php 
b/client/includes/InterwikiSorter.php
index 829981d..346cf45 100644
--- a/client/includes/InterwikiSorter.php
+++ b/client/includes/InterwikiSorter.php
@@ -45,8 +45,6 @@
         * @return array
         */
        public function sortLinks( array $links ) {
-               wfProfileIn( __METHOD__ );
-
                // Prepare the sorting array.
                $this->sortOrder = $this->buildSortOrder(
                        $this->sort,
@@ -66,7 +64,6 @@
                        $links[$k] = implode( ':', $langLink );
                }
 
-               wfProfileOut( __METHOD__ );
                return $links;
        }
 
diff --git a/client/includes/LangLinkHandler.php 
b/client/includes/LangLinkHandler.php
index 3e63c10..af2c8a0 100644
--- a/client/includes/LangLinkHandler.php
+++ b/client/includes/LangLinkHandler.php
@@ -113,7 +113,6 @@
         * @return SiteLink[] A map of SiteLinks, indexed by global site id.
         */
        public function getEntityLinks( Title $title ) {
-               wfProfileIn( __METHOD__ );
                wfDebugLog( __CLASS__, __FUNCTION__ . ": Looking for sitelinks 
defined by the "
                        . "corresponding item on the wikibase repo." );
 
@@ -144,7 +143,6 @@
                }
 
                wfDebugLog( __CLASS__, __FUNCTION__ . ": Found " . count( 
$links ) . " links." );
-               wfProfileOut( __METHOD__ );
 
                return $links;
        }
@@ -206,21 +204,17 @@
         * @return bool
         */
        public function useRepoLinks( Title $title, ParserOutput $out ) {
-               wfProfileIn( __METHOD__ );
-
                // use repoLinks in only the namespaces specified in settings
                if ( $this->namespaceChecker->isWikibaseEnabled( 
$title->getNamespace() ) === true ) {
                        $nel = $this->getNoExternalLangLinks( $out );
 
                        if( in_array( '*', $nel ) ) {
-                               wfProfileOut( __METHOD__ );
                                return false;
                        }
-                       wfProfileOut( __METHOD__ );
+
                        return true;
                }
 
-               wfProfileOut( __METHOD__ );
                return false;
        }
 
@@ -243,8 +237,6 @@
         *         entries removed.
         */
        public function suppressRepoLinks( ParserOutput $out, array $repoLinks 
) {
-               wfProfileIn( __METHOD__ );
-
                $nel = $this->getNoExternalLangLinks( $out );
 
                foreach ( $nel as $code ) {
@@ -263,7 +255,6 @@
 
                unset( $repoLinks[$this->siteId] ); // remove self-link
 
-               wfProfileOut( __METHOD__ );
                return $repoLinks;
        }
 
@@ -280,8 +271,6 @@
         *         pointing to a site in an allowed group.
         */
        public function filterRepoLinksByGroup( array $repoLinks, array 
$allowedGroups ) {
-               wfProfileIn( __METHOD__ );
-
                foreach ( $repoLinks as $wiki => $link ) {
                        if ( !$this->siteStore->getSite( $wiki ) ) {
                                wfDebugLog( __CLASS__, __FUNCTION__ . ': 
skipping link to unknown site ' . $wiki );
@@ -301,7 +290,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $repoLinks;
        }
 
@@ -330,8 +318,6 @@
         *           and the target pages on the respective wiki as the 
associated value.
         */
        private function localLinksToArray( array $flatLinks ) {
-               wfProfileIn( __METHOD__ );
-
                $links = array();
 
                foreach ( $flatLinks as $s ) {
@@ -352,7 +338,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $links;
        }
 
@@ -374,10 +359,7 @@
         *         and the target pages in the respective languages as the 
associated value.
         */
        public function getEffectiveRepoLinks( Title $title, ParserOutput $out 
) {
-               wfProfileIn( __METHOD__ );
-
                if ( !$this->useRepoLinks( $title, $out ) ) {
-                       wfProfileOut( __METHOD__ );
                        return array();
                }
 
@@ -393,7 +375,6 @@
 
                $repoLinks = array_diff_key( $repoLinks, $onPageLinks ); // 
remove local links
 
-               wfProfileOut( __METHOD__ );
                return $repoLinks;
        }
 
@@ -410,16 +391,12 @@
         * @param ParserOutput $out Parsed representation of the page
         */
        public function addLinksFromRepository( Title $title, ParserOutput $out 
) {
-               wfProfileIn( __METHOD__ );
-
                $repoLinks = $this->getEffectiveRepoLinks( $title, $out );
 
                $this->addLinksToOutput( $repoLinks, $out );
 
                $repoLinksByInterwiki = $this->indexLinksByInterwiki( 
$repoLinks );
                $this->badgeDisplay->attachBadgesToOutput( 
$repoLinksByInterwiki, $out );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -474,8 +451,6 @@
         * @param ParserOutput $out
         */
        public function updateItemIdProperty( Title $title, ParserOutput $out ) 
{
-               wfProfileIn( __METHOD__ );
-
                $itemId = $this->getItemIdForTitle( $title );
 
                if ( $itemId ) {
@@ -486,8 +461,6 @@
                } else {
                        $out->unsetProperty( 'wikibase_item' );
                }
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/client/includes/UpdateRepo/UpdateRepo.php 
b/client/includes/UpdateRepo/UpdateRepo.php
index 0f0100e..86192ad 100644
--- a/client/includes/UpdateRepo/UpdateRepo.php
+++ b/client/includes/UpdateRepo/UpdateRepo.php
@@ -132,15 +132,11 @@
         * @param JobQueueGroup $jobQueueGroup
         */
        public function injectJob( JobQueueGroup $jobQueueGroup ) {
-               wfProfileIn( __METHOD__ );
-
                $job = $this->createJob( $jobQueueGroup );
 
                wfProfileIn( __METHOD__ . '#push' );
                $jobQueueGroup->push( $job );
                wfProfileOut( __METHOD__ . '#push' );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -151,21 +147,15 @@
         * @return IJobSpecification
         */
        private function createJob( JobQueueGroup $jobQueueGroup ) {
-               wfProfileIn( __METHOD__ );
-
                $params = $this->getJobParameters();
                if ( $this->delayJobs( $jobQueueGroup ) ) {
                        $params['jobReleaseTimestamp'] = time() + 
$this->getJobDelay();
                }
 
-               $job = new JobSpecification(
+               return new JobSpecification(
                        $this->getJobName(),
                        $params
                );
-
-               wfProfileOut( __METHOD__ );
-
-               return $job;
        }
 
        /**
diff --git a/lib/includes/ChangeNotificationJob.php 
b/lib/includes/ChangeNotificationJob.php
index 73deb72..af61c08 100644
--- a/lib/includes/ChangeNotificationJob.php
+++ b/lib/includes/ChangeNotificationJob.php
@@ -38,7 +38,6 @@
         */
        public static function newFromChanges( array $changes, $repo = '', 
$params = false ) {
                static $dummyTitle = null;
-               wfProfileIn( __METHOD__ );
 
                // Note: we don't really care about the title and will use a 
dummy
                if ( $dummyTitle === null ) {
@@ -61,10 +60,7 @@
                $params['repo'] = $repo;
                $params['changeIds'] = $changeIds;
 
-               $job = new ChangeNotificationJob( $dummyTitle, $params );
-
-               wfProfileOut( __METHOD__ );
-               return $job;
+               return new ChangeNotificationJob( $dummyTitle, $params );
        }
 
        /**
diff --git a/lib/includes/ChangesTable.php b/lib/includes/ChangesTable.php
index ca2211d..65f0139 100644
--- a/lib/includes/ChangesTable.php
+++ b/lib/includes/ChangesTable.php
@@ -148,9 +148,7 @@
         * @return Change[]
         */
        public function loadChunk( $start, $size ) {
-               wfProfileIn( __METHOD__ );
-
-               $changes = $this->selectObjects(
+               return $this->selectObjects(
                        null,
                        array(
                                'id >= ' . intval( $start )
@@ -161,9 +159,6 @@
                        ),
                        __METHOD__
                );
-
-               wfProfileOut( __METHOD__ );
-               return $changes;
        }
 
        /**
diff --git a/lib/includes/LanguageFallbackChainFactory.php 
b/lib/includes/LanguageFallbackChainFactory.php
index b5d9678..fce66fd 100644
--- a/lib/includes/LanguageFallbackChainFactory.php
+++ b/lib/includes/LanguageFallbackChainFactory.php
@@ -128,8 +128,6 @@
         * @return LanguageWithConversion[]
         */
        public function buildFromLanguage( $language, $mode, &$chain = array(), 
&$fetched = array() ) {
-               wfProfileIn( __METHOD__ );
-
                if ( is_string( $language ) ) {
                        $languageCode = $language;
                } else {
@@ -191,7 +189,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $chain;
        }
 
@@ -227,20 +224,14 @@
         * @return LanguageFallbackChain
         */
        public function newFromUserAndLanguageCode( User $user, $languageCode ) 
{
-               wfProfileIn( __METHOD__ );
-
                if ( !class_exists( 'Babel' ) || $user->isAnon() ) {
-                       $cached =  $this->newFromLanguageCode( $languageCode, 
self::FALLBACK_ALL );
-                       wfProfileOut( __METHOD__ );
-                       return $cached;
+                       return $this->newFromLanguageCode( $languageCode, 
self::FALLBACK_ALL );
                }
 
                $languageCode = LanguageWithConversion::validateLanguageCode( 
$languageCode );
 
                if ( isset( 
$this->userLanguageCache[$user->getName()][$languageCode] ) ) {
-                       $cached = 
$this->userLanguageCache[$user->getName()][$languageCode];
-                       wfProfileOut( __METHOD__ );
-                       return $cached;
+                       return 
$this->userLanguageCache[$user->getName()][$languageCode];
                }
 
                $babel = $this->getBabel( $languageCode, $user );
@@ -250,7 +241,6 @@
 
                $this->userLanguageCache[$user->getName()][$languageCode] = 
$languageFallbackChain;
 
-               wfProfileOut( __METHOD__ );
                return $languageFallbackChain;
        }
 
@@ -303,8 +293,6 @@
         * @return LanguageWithConversion[]
         */
        public function buildFromBabel( array $babel ) {
-               wfProfileIn( __METHOD__ );
-
                $chain = array();
                $fetched = array();
 
@@ -336,7 +324,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $chain;
        }
 
diff --git a/lib/includes/store/CachingEntityRevisionLookup.php 
b/lib/includes/store/CachingEntityRevisionLookup.php
index c4404ba..d269868 100644
--- a/lib/includes/store/CachingEntityRevisionLookup.php
+++ b/lib/includes/store/CachingEntityRevisionLookup.php
@@ -101,7 +101,6 @@
         * @return EntityRevision|null
         */
        public function getEntityRevision( EntityId $entityId, $revisionId = 
self::LATEST_FROM_SLAVE ) {
-               wfProfileIn( __METHOD__ );
                $key = $this->getCacheKey( $entityId );
 
                if ( $revisionId === 0 ) {
@@ -132,7 +131,6 @@
                        $entityRevision = $this->fetchEntityRevision( 
$entityId, $revisionId );
                }
 
-               wfProfileOut( __METHOD__ );
                return $entityRevision;
        }
 
@@ -146,8 +144,6 @@
         * @return EntityRevision|null
         */
        private function fetchEntityRevision( EntityId $entityId, $revisionId ) 
{
-               wfProfileIn( __METHOD__ );
-
                $key = $this->getCacheKey( $entityId );
                $entityRevision = $this->lookup->getEntityRevision( $entityId, 
$revisionId );
 
@@ -159,7 +155,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $entityRevision;
        }
 
diff --git a/lib/includes/store/TermPropertyLabelResolver.php 
b/lib/includes/store/TermPropertyLabelResolver.php
index 9c3f96b..ca69813 100644
--- a/lib/includes/store/TermPropertyLabelResolver.php
+++ b/lib/includes/store/TermPropertyLabelResolver.php
@@ -105,14 +105,10 @@
                        return $this->propertiesByLabel;
                }
 
-               wfProfileIn( __METHOD__ );
-
                $cached = $this->getCachedLabelMap( $recache );
 
                if ( $cached !== false && $cached !== null ) {
                        $this->propertiesByLabel = $cached;
-
-                       wfProfileOut( __METHOD__ );
                        return $this->propertiesByLabel;
                }
 
@@ -120,15 +116,11 @@
 
                $this->cache->set( $this->cacheKey, $this->propertiesByLabel, 
$this->cacheDuration );
 
-               wfProfileOut( __METHOD__ );
-
                return $this->propertiesByLabel;
 
        }
 
        protected function loadProperties() {
-               wfProfileIn( __METHOD__ );
-
                $termTemplate = new Term( array(
                        'termType' => 'label',
                        'termLanguage' => $this->languageCode,
@@ -152,8 +144,6 @@
                        $label = $term->getText();
                        $propertiesByLabel[$label] = $term->getEntityId();
                }
-
-               wfProfileOut( __METHOD__ );
 
                return $propertiesByLabel;
        }
diff --git a/lib/includes/store/sql/PropertyInfoTable.php 
b/lib/includes/store/sql/PropertyInfoTable.php
index fe18463..02e8047 100644
--- a/lib/includes/store/sql/PropertyInfoTable.php
+++ b/lib/includes/store/sql/PropertyInfoTable.php
@@ -58,8 +58,6 @@
         * @throws DBError
         */
        public function getPropertyInfo( PropertyId $propertyId ) {
-               wfProfileIn( __METHOD__ );
-
                $dbw = $this->getConnection( DB_SLAVE );
 
                $res = $dbw->selectField(
@@ -81,7 +79,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $info;
        }
 
@@ -115,7 +112,6 @@
         * @throws DBError
         */
        public function getAllPropertyInfo() {
-               wfProfileIn( __METHOD__ );
                $dbw = $this->getConnection( DB_SLAVE );
 
                $res = $dbw->select(
@@ -141,7 +137,6 @@
 
                $this->releaseConnection( $dbw );
 
-               wfProfileOut( __METHOD__ );
                return $infos;
        }
 
@@ -163,8 +158,6 @@
                        throw new InvalidArgumentException( 'Missing required 
info field: ' . PropertyInfoStore::KEY_DATA_TYPE );
                }
 
-               wfProfileIn( __METHOD__ );
-
                $type = $info[ PropertyInfoStore::KEY_DATA_TYPE ];
                $json = json_encode( $info );
 
@@ -182,8 +175,6 @@
                );
 
                $this->releaseConnection( $dbw );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -200,7 +191,6 @@
                        throw new DBError( 'Cannot write when in readonly mode' 
);
                }
 
-               wfProfileIn( __METHOD__ );
                $dbw = $this->getConnection( DB_MASTER );
 
                $dbw->delete(
@@ -212,7 +202,6 @@
                $c = $dbw->affectedRows();
                $this->releaseConnection( $dbw );
 
-               wfProfileOut( __METHOD__ );
                return $c > 0;
        }
 
diff --git a/lib/includes/store/sql/SiteLinkTable.php 
b/lib/includes/store/sql/SiteLinkTable.php
index 20f3174..9a9248b 100644
--- a/lib/includes/store/sql/SiteLinkTable.php
+++ b/lib/includes/store/sql/SiteLinkTable.php
@@ -92,8 +92,6 @@
         * @return boolean Success indicator
         */
        public function saveLinksOfItem( Item $item ) {
-               wfProfileIn( __METHOD__ );
-
                //First check whether there's anything to update
                $newLinks = $item->getSiteLinks();
                $oldLinks = $this->getSiteLinksForItem( $item->getId() );
@@ -103,7 +101,6 @@
 
                if ( !$linksToInsert && !$linksToDelete ) {
                        wfDebugLog( __CLASS__, __FUNCTION__ . ": links did not 
change, returning." );
-                       wfProfileOut( __METHOD__ );
                        return true;
                }
 
@@ -123,7 +120,6 @@
                }
 
                $this->releaseConnection( $dbw );
-               wfProfileOut( __METHOD__ );
 
                return $ok;
        }
@@ -143,8 +139,6 @@
         * @return boolean Success indicator
         */
        public function insertLinksInternal( Item $item, $links, DatabaseBase 
$dbw ) {
-               wfProfileIn( __METHOD__ );
-
                wfDebugLog( __CLASS__, __FUNCTION__ . ': inserting links for ' 
. $item->getId()->getSerialization() );
 
                $success = true;
@@ -164,7 +158,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $success;
        }
 
@@ -184,8 +177,6 @@
         * @return boolean Success indicator
         */
        public function deleteLinksInternal( Item $item, $links, DatabaseBase 
$dbw ) {
-               wfProfileIn( __METHOD__ );
-
                wfDebugLog( __CLASS__, __FUNCTION__ . ': deleting links for ' . 
$item->getId()->getSerialization() );
 
                //TODO: We can do this in a single query by collecting all the 
site IDs into a set.
@@ -206,7 +197,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $success;
        }
 
@@ -290,12 +280,9 @@
         * @return array[]
         */
        public function getConflictsForItem( Item $item, DatabaseBase $db = 
null ) {
-               wfProfileIn( __METHOD__ );
-
                $links = $item->getSiteLinks();
 
                if ( $links === array() ) {
-                       wfProfileOut( __METHOD__ );
                        return array();
                }
 
@@ -349,7 +336,6 @@
                        $this->releaseConnection( $dbr );
                }
 
-               wfProfileOut( __METHOD__ );
                return $conflicts;
        }
 
diff --git a/lib/includes/store/sql/SqlEntityInfoBuilder.php 
b/lib/includes/store/sql/SqlEntityInfoBuilder.php
index c951fa1..a811ca7 100644
--- a/lib/includes/store/sql/SqlEntityInfoBuilder.php
+++ b/lib/includes/store/sql/SqlEntityInfoBuilder.php
@@ -315,8 +315,6 @@
                        return;
                }
 
-               wfProfileIn( __METHOD__ );
-
                //NOTE: we make one DB query per entity type, so we can take 
advantage of the
                //      database index on the term_entity_type field.
                foreach ( array_keys( $this->numericIdsByType ) as $type ) {
@@ -330,8 +328,6 @@
                foreach ( $termTypes as $type ) {
                        $this->setDefaultValue( self::$termTypeFields[$type], 
array() );
                }
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -342,8 +338,6 @@
         * @param string[]|null $languages
         */
        private function collectTermsForEntities( $entityType, array $termTypes 
= null, array $languages = null ) {
-               wfProfileIn( __METHOD__ );
-
                $entityIds = $this->numericIdsByType[$entityType];
 
                $where = array(
@@ -371,8 +365,6 @@
                $this->injectTerms( $res );
 
                $this->releaseConnection( $dbw );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -454,8 +446,6 @@
        public function collectDataTypes() {
                //TODO: use PropertyDataTypeLookup service to make use of 
caching!
 
-               wfProfileIn( __METHOD__ );
-
                if ( empty( $this->numericIdsByType[Property::ENTITY_TYPE] ) ) {
                        // there are no Property entities, so there is nothing 
to do.
                        return;
@@ -478,8 +468,6 @@
                } );
 
                $this->releaseConnection( $dbw );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -508,12 +496,9 @@
         * @see EntityInfoBuilder::removeMissing
         */
        public function removeMissing( $redirects = 'keep-redirects' ) {
-               wfProfileIn( __METHOD__ );
-
                $missingIds = $this->getMissingIds( $redirects !== 
'keep-redirects' );
 
                $this->unsetEntityInfo( $missingIds );
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -546,8 +531,6 @@
                if ( isset( $this->pageInfoByType[$entityType] ) ) {
                        return $this->pageInfoByType[$entityType];
                }
-
-               wfProfileIn( __METHOD__ );
 
                $entityIds = $this->numericIdsByType[$entityType];
 
@@ -586,8 +569,6 @@
                }
 
                $this->releaseConnection( $dbw );
-
-               wfProfileOut( __METHOD__ );
 
                return $this->pageInfoByType[$entityType];
        }
diff --git a/lib/includes/store/sql/TermSqlIndex.php 
b/lib/includes/store/sql/TermSqlIndex.php
index 123cfe3..c642753 100644
--- a/lib/includes/store/sql/TermSqlIndex.php
+++ b/lib/includes/store/sql/TermSqlIndex.php
@@ -94,8 +94,6 @@
         * @return boolean Success indicator
         */
        public function saveTermsOfEntity( EntityDocument $entity ) {
-               wfProfileIn( __METHOD__ );
-
                //First check whether there's anything to update
                $newTerms = $this->getEntityTerms( $entity );
                $oldTerms = $this->getTermsOfEntity( $entity->getId() );
@@ -105,7 +103,6 @@
 
                if ( !$termsToInsert && !$termsToDelete ) {
                        wfDebugLog( __CLASS__, __FUNCTION__ . ': terms did not 
change, returning.' );
-                       wfProfileOut( __METHOD__ );
                        return true;
                }
 
@@ -123,7 +120,6 @@
                }
 
                $this->releaseConnection( $dbw );
-               wfProfileOut( __METHOD__ );
 
                return $ok;
        }
@@ -143,8 +139,6 @@
         * @return boolean Success indicator
         */
        public function insertTermsInternal( EntityDocument $entity, $terms, 
DatabaseBase $dbw ) {
-               wfProfileIn( __METHOD__ );
-
                $entityIdentifiers = array(
                        // FIXME: this will fail for IDs that do not have a 
numeric form
                        'term_entity_id' => $entity->getId()->getNumericId(),
@@ -176,8 +170,6 @@
                                break;
                        }
                }
-
-               wfProfileOut( __METHOD__ );
 
                return $success;
        }
@@ -260,8 +252,6 @@
         * @return boolean Success indicator
         */
        public function deleteTermsInternal( EntityId $entityId, $terms, 
DatabaseBase $dbw ) {
-               wfProfileIn( __METHOD__ );
-
                //TODO: Make getTermsOfEntity() collect term_row_id values, so 
we can use them here.
                //      That would allow us to do the deletion in a single 
query, based on a set of ids.
 
@@ -293,8 +283,6 @@
                                break;
                        }
                }
-
-               wfProfileOut( __METHOD__ );
 
                return $success;
        }
@@ -356,8 +344,6 @@
         * @return boolean Success indicator
         */
        public function deleteTermsOfEntity( EntityId $entityId ) {
-               wfProfileIn( __METHOD__ );
-
                $dbw = $this->getConnection( DB_MASTER );
 
                $success = $dbw->delete(
@@ -373,7 +359,6 @@
                // for other entities, without any way to remove them from the 
database.
                // We probably want some extra handling here.
 
-               wfProfileOut( __METHOD__ );
                return $success;
        }
 
@@ -442,8 +427,6 @@
                        return array();
                }
 
-               wfProfileIn( __METHOD__ );
-
                $entityType = null;
                $numericIds = array();
 
@@ -482,8 +465,6 @@
                $terms = $this->buildTermResult( $res );
 
                $this->releaseConnection( $dbr );
-
-               wfProfileOut( __METHOD__ );
 
                return $terms;
        }
@@ -527,8 +508,6 @@
                        return array();
                }
 
-               wfProfileIn( __METHOD__ );
-
                $dbr = $this->getReadDb();
 
                $termConditions = $this->termsToConditions( $dbr, $terms, 
$termType, $entityType, $options );
@@ -554,8 +533,6 @@
 
                $this->releaseConnection( $dbr );
 
-               wfProfileOut( __METHOD__ );
-
                return $terms;
        }
 
@@ -574,8 +551,6 @@
                if ( empty( $terms ) ) {
                        return array();
                }
-
-               wfProfileIn( __METHOD__ );
 
                // this is the maximum limit of search results
                // TODO this should not be hardcoded
@@ -648,8 +623,6 @@
                        $result[] = 
LegacyIdInterpreter::newIdFromTypeAndNumber( $entityType, $numericId );
                }
 
-               wfProfileOut( __METHOD__ );
-
                return $result;
        }
 
@@ -663,16 +636,12 @@
         * @return string[]
         */
        private function termsToConditions( DatabaseBase $db, array $terms, 
$termType, $entityType, array $options = array() ) {
-               wfProfileIn( __METHOD__ );
-
                $conditions = array();
 
                foreach ( $terms as $term ) {
                        $termConditions = $this->termMatchConditions( $db, 
$term, $termType, $entityType, $options );
                        $conditions[] = '(' . implode( ' AND ', $termConditions 
) . ')';
                }
-
-               wfProfileOut( __METHOD__ );
 
                return $conditions;
        }
@@ -689,8 +658,6 @@
         * @return array
         */
        protected function termMatchConditions( DatabaseBase $db, Term $term, 
$termType, $entityType, array $options = array() ) {
-               wfProfileIn( __METHOD__ );
-
                $options = array_merge(
                        array(
                                'caseSensitive' => true,
@@ -748,8 +715,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
-
                return $conditions;
        }
 
@@ -764,8 +729,6 @@
         * @return Term[]
         */
        protected function buildTermResult( $obtainedTerms ) {
-               wfProfileIn( __METHOD__ );
-
                $matchingTerms = array();
 
                foreach ( $obtainedTerms as $obtainedTerm ) {
@@ -786,8 +749,6 @@
 
                        $matchingTerms[] = new Term( $matchingTerm );
                }
-
-               wfProfileOut( __METHOD__ );
 
                return $matchingTerms;
        }
@@ -829,7 +790,6 @@
                        return array();
                }
 
-               wfProfileIn( __METHOD__ );
                $templates = $this->makeQueryTerms( $labels, Term::TYPE_LABEL );
 
                $labelConflicts = $this->getMatchingTerms(
@@ -841,7 +801,6 @@
                        )
                );
 
-               wfProfileOut( __METHOD__ );
                return $labelConflicts;
        }
 
@@ -868,15 +827,12 @@
                        return array();
                }
 
-               wfProfileIn( __METHOD__ );
-
                $dbr = $this->getReadDb();
 
                // FIXME: MySQL doesn't support self-joins on temporary tables,
                //        so skip this check during unit tests on MySQL!
                if ( defined( 'MW_PHPUNIT_TEST' ) && $dbr->getType() === 
'mysql' ) {
                        $this->releaseConnection( $dbr );
-                       wfProfileOut( __METHOD__ );
                        return array();
                }
 
@@ -921,7 +877,6 @@
 
                $this->releaseConnection( $dbr );
 
-               wfProfileOut( __METHOD__ );
                return $conflicts;
        }
 
diff --git a/lib/includes/store/sql/WikiPageEntityRevisionLookup.php 
b/lib/includes/store/sql/WikiPageEntityRevisionLookup.php
index 98fc076..ffc5d94 100644
--- a/lib/includes/store/sql/WikiPageEntityRevisionLookup.php
+++ b/lib/includes/store/sql/WikiPageEntityRevisionLookup.php
@@ -61,7 +61,6 @@
         * @return EntityRevision|null
         */
        public function getEntityRevision( EntityId $entityId, $revisionId = 
self::LATEST_FROM_SLAVE ) {
-               wfProfileIn( __METHOD__ );
                wfDebugLog( __CLASS__, __FUNCTION__ . ': Looking up entity ' . 
$entityId
                        . " (revision $revisionId)." );
 
@@ -83,7 +82,6 @@
 
                        if ( $redirect !== null ) {
                                // TODO: Optionally follow redirects. Doesn't 
make sense if a revision ID is given.
-                               wfProfileOut( __METHOD__ );
                                throw new UnresolvedRedirectException( 
$redirect->getTargetId() );
                        }
 
@@ -106,7 +104,6 @@
                        throw new BadRevisionException( "No such revision found 
for $entityId: $revisionId" );
                }
 
-               wfProfileOut( __METHOD__ );
                return $entityRevision;
        }
 
@@ -190,7 +187,6 @@
         * @return object|null a raw database row object, or null if no such 
entity revision exists.
         */
        private function selectRevisionRow( EntityId $entityId, $revisionId, 
$connType ) {
-               wfProfileIn( __METHOD__ );
                $db = $this->getConnection( $connType );
 
                $where = array();
@@ -243,7 +239,6 @@
                        $row = null;
                }
 
-               wfProfileOut( __METHOD__ );
                return $row;
        }
 
@@ -259,7 +254,6 @@
         * @return object|null a raw database row object, or null if no such 
entity revision exists.
         */
        protected function selectPageLatest( EntityId $entityId, $connType = 
DB_SLAVE ) {
-               wfProfileIn( __METHOD__ );
                $db = $this->getConnection( $connType );
 
                $tables = array(
@@ -285,8 +279,6 @@
                        // this can only happen if the DB is set to ignore 
errors, which shouldn't be the case...
                        $error = $db->lastError();
                        $errno = $db->lastErrno();
-
-                       wfProfileOut( __METHOD__ );
                        throw new DBQueryError( $db, $error, $errno, '', 
__METHOD__ );
                }
 
@@ -296,7 +288,6 @@
                        $row = null;
                }
 
-               wfProfileOut( __METHOD__ );
                return $row;
        }
 
@@ -324,8 +315,6 @@
         * with either $entityRevision or $entityRedirect or both being null 
(but not both being non-null).
         */
        private function loadEntity( $row ) {
-               wfProfileIn( __METHOD__ );
-
                $blob = $this->loadEntityBlob( $row );
                $entity = $this->contentCodec->decodeEntity( $blob, 
$row->rev_content_format );
 
@@ -345,7 +334,6 @@
                        $result = array( null, $redirect );
                }
 
-               wfProfileOut( __METHOD__ );
                return $result;
        }
 
@@ -363,7 +351,6 @@
         * @return string The blob
         */
        private function loadEntityBlob( $row ) {
-               wfProfileIn( __METHOD__ );
                wfDebugLog( __CLASS__, __FUNCTION__ . ': Calling 
getRevisionText() on revision '
                        . $row->rev_id );
 
@@ -371,8 +358,6 @@
                //      cause any problems, since getRevisionText should only 
look at the old_flags
                //      and old_text fields. But be aware.
                $blob = Revision::getRevisionText( $row, 'old_', $this->wiki );
-
-               wfProfileOut( __METHOD__ );
 
                if ( $blob === false ) {
                        wfWarn( 'Unable to load raw content blob for revision ' 
. $row->rev_id );
diff --git a/lib/maintenance/dispatchChanges.php 
b/lib/maintenance/dispatchChanges.php
index 3ea57a9..f2131d8 100644
--- a/lib/maintenance/dispatchChanges.php
+++ b/lib/maintenance/dispatchChanges.php
@@ -294,8 +294,6 @@
         * @return int The number of changes dispatched
         */
        public function dispatchTo( $wikiState ) {
-               wfProfileIn( __METHOD__ );
-
                $wikiDB = $wikiState['chd_db'];
                $siteID = $wikiState['chd_site'];
                $after = intval( $wikiState['chd_seen'] );
@@ -328,7 +326,6 @@
                                . "Next ID is $continueAfter." );
                }
 
-               wfProfileOut( __METHOD__ );
                return $n;
        }
 
@@ -353,8 +350,6 @@
         * @see releaseWiki()
         */
        protected function selectClient() {
-               wfProfileIn( __METHOD__ );
-
                $candidates = $this->getCandidateClients();
 
                while ( $candidates ) {
@@ -368,7 +363,6 @@
 
                        if ( $state ) {
                                // got one
-                               wfProfileOut( __METHOD__ );
                                return $state;
                        }
 
@@ -376,7 +370,6 @@
                }
 
                // we ran out of candidates
-               wfProfileOut( __METHOD__ );
                return null;
        }
 
@@ -389,7 +382,6 @@
         * @see selectClient()
         */
        protected function getCandidateClients() {
-               wfProfileIn( __METHOD__ );
                $db = $this->getRepoMaster();
 
                // XXX: subject to clock skew. Use DB based "now" time?
@@ -440,7 +432,6 @@
                        $candidates[] = $row['chd_site'];
                }
 
-               wfProfileOut( __METHOD__ );
                return $candidates;
        }
 
@@ -449,7 +440,6 @@
         * that are in the configuration but not yet in the dispatch table.
         */
        protected function initStateTable() {
-               wfProfileIn( __METHOD__ );
                $db = $this->getRepoMaster();
 
                $res = $db->select( $this->stateTable,
@@ -487,8 +477,6 @@
                }
 
                $this->releaseRepoMaster( $db );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -510,7 +498,6 @@
                                        ."consider removing it from the " . 
$this->stateTable );
                }
 
-               wfProfileIn( __METHOD__ );
                $wikiDB = $this->clientWikis[ $siteID ];
 
                $this->trace( "Trying $siteID" );
@@ -536,8 +523,6 @@
 
                        if ( !$state ) {
                                $this->log( "ERROR: $siteID is not in the 
dispatch table." );
-
-                               wfProfileOut( __METHOD__ );
                                return false;
                        } else {
                                $this->trace( "Loading state for $siteID" );
@@ -554,8 +539,6 @@
 
                                        $db->rollback( __METHOD__ );
                                        $this->releaseRepoMaster( $db );
-
-                                       wfProfileOut( __METHOD__ );
                                        return false;
                                }
                        }
@@ -573,8 +556,6 @@
 
                                $db->rollback( __METHOD__ );
                                $this->releaseRepoMaster( $db );
-
-                               wfProfileOut( __METHOD__ );
                                return false;
                        }
 
@@ -593,8 +574,6 @@
                } catch ( \Exception $ex ) {
                        $db->rollback( __METHOD__ );
                        $this->releaseRepoMaster( $db );
-                       wfProfileOut( __METHOD__ );
-
                        throw $ex;
                }
 
@@ -605,7 +584,6 @@
 
                unset( $state['chd_disabled'] ); // don't mess with this.
 
-               wfProfileOut( __METHOD__ );
                return $state;
        }
 
@@ -621,8 +599,6 @@
         * @see selectWiki()
         */
        protected function releaseClient( $seen, array $state ) {
-               wfProfileIn( __METHOD__ );
-
                $siteID = $state['chd_site'];
                $wikiDB = $state['chd_db'];
 
@@ -648,8 +624,6 @@
                } catch ( \Exception $ex ) {
                        $db->rollback( __METHOD__ );
                        $this->releaseRepoMaster( $db );
-
-                       wfProfileOut( __METHOD__ );
                        throw $ex;
                }
 
@@ -657,7 +631,6 @@
                $this->releaseRepoMaster( $db );
 
                $this->trace( "Released $wikiDB for site $siteID at $seen." );
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -683,8 +656,6 @@
         * @return string|bool The lock name if the lock was acquired, false 
otherwise.
         */
        protected function getClientLock( $wikiDB, $lockName = null ) {
-               wfProfileIn( __METHOD__ );
-
                $this->trace( "Trying to get client lock for $wikiDB" );
 
                if ( $lockName === null ) {
@@ -702,7 +673,6 @@
                $msg = $ok ? "Set lock for $wikiDB" : "Failed to set lock for 
$wikiDB";
                $this->trace( $msg );
 
-               wfProfileOut( __METHOD__ );
                return $ok ? $lockName : false;
        }
 
@@ -717,13 +687,10 @@
         * @return bool whether the lock was released successfully.
         */
        protected function releaseClientLock( $wikiDB, $lock ) {
-               wfProfileIn( __METHOD__ );
-
                $db = $this->getClientMaster( $wikiDB );
                $ok = $db->unlock( $lock, __METHOD__ );
                $this->releaseClientMaster( $wikiDB, $db );
 
-               wfProfileOut( __METHOD__ );
                return $ok;
        }
 
@@ -738,13 +705,10 @@
         * @return bool true if the given lock is currently held by another 
process, false otherwise.
         */
        protected function isClientLockUsed( $wikiDB, $lock ) {
-               wfProfileIn( __METHOD__ );
-
                $db = $this->getClientMaster( $wikiDB );
                $free = $db->lockIsFree( $lock, __METHOD__ );
                $this->releaseClientMaster( $wikiDB, $db );
 
-               wfProfileOut( __METHOD__ );
                return !$free;
        }
 
@@ -768,8 +732,6 @@
         *         for use as a continuation marker.
         */
        public function getPendingChanges( $siteID, $wikiDB, $after ) {
-               wfProfileIn( __METHOD__ );
-
                // Loop until we have a full batch of size $this->batchSize,
                // or there are no more changes to process.
 
@@ -809,8 +771,6 @@
                        //     $chunkSize = ( $this->batchSize - count( $batch 
) ) * ( count_before / count_after );
                }
 
-               wfProfileOut( __METHOD__ );
-
                $this->trace( "Got " . count( $batch ) . " pending changes. "
                        . sprintf( "Cache hit rate is %2d%%", 
$this->changesCache->getHitRatio() * 100 ) );
 
@@ -832,18 +792,14 @@
         * @return bool
         */
        protected function isRelevantChange( Change $change, $siteID ) {
-               wfProfileIn( __METHOD__ );
-
                if ( $change instanceof ItemChange && !$change->isEmpty() ) {
                        $siteLinkDiff = $change->getSiteLinkDiff();
 
                        if ( isset( $siteLinkDiff[ $siteID ] ) ) {
-                               wfProfileOut( __METHOD__ );
                                return true;
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return false;
        }
 
@@ -863,8 +819,6 @@
         *         (even if that was filtered out), for use as a continuation 
marker.
         */
        protected function filterChanges( $siteID, $wikiDB, $changes, $limit ) {
-               wfProfileIn( __METHOD__ );
-
                // collect all item IDs mentioned in the changes
                $itemSet = array();
                foreach ( $changes as $change ) {
@@ -920,7 +874,6 @@
 
                $this->trace( "Found " . count( $filteredChanges ) . " changes 
for items with relevant sitelinks." );
 
-               wfProfileOut( __METHOD__ );
                return array( $filteredChanges, $lastIdSeen );
        }
 
@@ -941,8 +894,6 @@
                        return; // nothing to do
                }
 
-               wfProfileIn( __METHOD__ );
-
                //TODO: allow a mock JQG for testing
                wfProfileIn( __METHOD__ . '#queue' );
                $qgroup = \JobQueueGroup::singleton( $wikiDB );
@@ -962,8 +913,6 @@
 
                $this->trace( "Posted notification job for site $siteID with "
                        . count( $changes ) . " changes to $wikiDB." );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index 9424e6c..d3be526 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -80,14 +80,12 @@
         * @return bool
         */
        public static function onSetupAfterCache() {
-               wfProfileIn( __METHOD__ );
                global $wgNamespaceContentModels;
 
                $namespaces = WikibaseRepo::getDefaultInstance()->
                        getSettings()->getSetting( 'entityNamespaces' );
 
                if ( empty( $namespaces ) ) {
-                       wfProfileOut( __METHOD__ );
                        throw new MWException( 'Wikibase: Incomplete 
configuration: '
                                . '$wgWBRepoSettings["entityNamespaces"] has to 
be set to an '
                                . 'array mapping content model IDs to namespace 
IDs. '
@@ -100,7 +98,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -201,15 +198,12 @@
         * @return bool
         */
        public static function onNamespaceIsMovable( $ns, &$movable ) {
-               wfProfileIn( __METHOD__ );
-
                $entityNamespaceLookup = 
WikibaseRepo::getDefaultInstance()->getEntityNamespaceLookup();
 
                if ( $entityNamespaceLookup->isEntityNamespace( $ns ) ) {
                        $movable = false;
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -227,8 +221,6 @@
         * @return bool
         */
        public static function onNewRevisionFromEditComplete( $article, 
Revision $revision, $baseID, User $user ) {
-               wfProfileIn( __METHOD__ );
-
                $entityContentFactory = 
WikibaseRepo::getDefaultInstance()->getEntityContentFactory();
 
                if ( $entityContentFactory->isEntityContentModel( 
$article->getContent()->getModel() ) ) {
@@ -244,7 +236,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -292,13 +283,10 @@
        public static function onArticleDeleteComplete( WikiPage $wikiPage, 
User $user, $reason, $id,
                Content $content = null, LogEntryBase $logEntry = null
        ) {
-               wfProfileIn( __METHOD__ );
-
                $entityContentFactory = 
WikibaseRepo::getDefaultInstance()->getEntityContentFactory();
 
                // Bail out if we are not looking at an entity
                if ( !$content || !$entityContentFactory->isEntityContentModel( 
$content->getModel() ) ) {
-                       wfProfileOut( __METHOD__ );
                        return true;
                }
 
@@ -311,7 +299,6 @@
                $notifier = 
WikibaseRepo::getDefaultInstance()->getChangeNotifier();
                $notifier->notifyOnPageDeleted( $content, $user, 
$logEntry->getTimestamp() );
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -327,13 +314,10 @@
         * @return bool
         */
        public static function onArticleUndelete( Title $title, $created, 
$comment ) {
-               wfProfileIn( __METHOD__ );
-
                $entityContentFactory = 
WikibaseRepo::getDefaultInstance()->getEntityContentFactory();
 
                // Bail out if we are not looking at an entity
                if ( !$entityContentFactory->isEntityContentModel( 
$title->getContentModel() ) ) {
-                       wfProfileOut( __METHOD__ );
                        return true;
                }
 
@@ -342,7 +326,6 @@
                $content = $revision ? $revision->getContent() : null;
 
                if ( !( $content instanceof EntityContent ) ) {
-                       wfProfileOut( __METHOD__ );
                        return true;
                }
 
@@ -355,7 +338,6 @@
                $notifier = 
WikibaseRepo::getDefaultInstance()->getChangeNotifier();
                $notifier->notifyOnPageUndeleted( $revision );
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -419,8 +401,6 @@
         * @return bool
         */
        public static function onGetPreferences( User $user, array 
&$preferences ) {
-               wfProfileIn( __METHOD__ );
-
                $preferences['wb-acknowledgedcopyrightversion'] = array(
                        'type' => 'api'
                );
@@ -438,7 +418,6 @@
                        $user->saveSettings();
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -451,13 +430,10 @@
         * @return bool
         */
        public static function onUserGetDefaultOptions( array &$defaultOptions 
) {
-               wfProfileIn( __METHOD__ );
-
                // pre-select default language in the list of fallback languages
                $defaultLang = $defaultOptions['language'];
                $defaultOptions[ 'wb-languages-' . $defaultLang ] = 1;
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -475,8 +451,6 @@
         * @return bool
         */
        public static function onPageHistoryLineEnding( HistoryPager $history, 
&$row, &$s, array &$classes  ) {
-               wfProfileIn( __METHOD__ );
-
                $entityContentFactory = 
WikibaseRepo::getDefaultInstance()->getEntityContentFactory();
 
                $article = $history->getArticle();
@@ -499,7 +473,6 @@
                        $s .= " " . $history->msg( 'parentheses' )->rawParams( 
$link )->escaped();
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -515,8 +488,6 @@
         * @return bool
         */
        public static function onPageTabs( SkinTemplate &$skinTemplate, array 
&$links ) {
-               wfProfileIn( __METHOD__ );
-
                $entityContentFactory = 
WikibaseRepo::getDefaultInstance()->getEntityContentFactory();
 
                $title = $skinTemplate->getTitle();
@@ -555,7 +526,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -570,8 +540,6 @@
         * @return bool
         */
        public static function onWikibaseRebuildData( $reportMessage ) {
-               wfProfileIn( __METHOD__ );
-
                $store = WikibaseRepo::getDefaultInstance()->getStore();
 
                $reportMessage(
@@ -582,7 +550,6 @@
 
                $reportMessage( "done!\n" );
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -612,8 +579,6 @@
         * @return bool
         */
        public static function onWikibaseDeleteData( $reportMessage ) {
-               wfProfileIn( __METHOD__ );
-
                $entityNamespaceLookup = 
WikibaseRepo::getDefaultInstance()->getEntityNamespaceLookup();
 
                $reportMessage( 'Deleting data from changes table...' );
@@ -653,7 +618,6 @@
 
                $reportMessage( "done!\n" );
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -739,8 +703,6 @@
         * @return bool true to continue execution, false to abort and with 
$message as an error message.
         */
        public static function onApiCheckCanExecute( ApiBase $module, User 
$user, &$message ) {
-               wfProfileIn( __METHOD__ );
-
                $entityContentFactory = 
WikibaseRepo::getDefaultInstance()->getEntityContentFactory();
 
                if ( $module instanceof ApiEditPage ) {
@@ -758,7 +720,6 @@
 
                                        // allow undo
                                        if ( $params['undo'] > 0 ) {
-                                               wfProfileOut( __METHOD__ );
                                                return true;
                                        }
 
@@ -768,13 +729,11 @@
                                                
$pageObj->getTitle()->getNsText()
                                        );
 
-                                       wfProfileOut( __METHOD__ );
                                        return false;
                                }
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -801,8 +760,6 @@
        public static function onShowSearchHit( SpecialSearch $searchPage, 
SearchResult $result, $terms,
                &$link, &$redirect, &$section, &$extract, &$score, &$size, 
&$date, &$related, &$html
        ) {
-               wfProfileIn( __METHOD__ );
-
                $entityContentFactory = 
WikibaseRepo::getDefaultInstance()->getEntityContentFactory();
 
                $title = $result->getTitle();
@@ -828,7 +785,6 @@
                        $extract = ''; // TODO: set this to something useful.
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
diff --git a/repo/includes/BabelUserLanguageLookup.php 
b/repo/includes/BabelUserLanguageLookup.php
index 8fd002f..5103946 100644
--- a/repo/includes/BabelUserLanguageLookup.php
+++ b/repo/includes/BabelUserLanguageLookup.php
@@ -81,8 +81,6 @@
         * @return string[] List of all the user's language codes.
         */
        public function getAllUserLanguages( User $user ) {
-               wfProfileIn( __METHOD__ );
-
                $languages = array();
 
                // Start with the user's UI language
@@ -97,7 +95,6 @@
                        $languages = array_unique( $languages );
                }
 
-               wfProfileOut( __METHOD__ );
                return $languages;
        }
 
diff --git a/repo/includes/EditEntity.php b/repo/includes/EditEntity.php
index eb65d3f..ef03d5c 100644
--- a/repo/includes/EditEntity.php
+++ b/repo/includes/EditEntity.php
@@ -267,7 +267,6 @@
                        return null;
                }
 
-               wfProfileIn( __METHOD__ );
                if ( $this->latestRev === null ) {
                        //NOTE: it's important to remember this, if someone 
calls clear() on $this->getPage(), this should NOT change!
                        $this->latestRev = 
$this->entityRevisionLookup->getEntityRevision(
@@ -276,7 +275,6 @@
                        );
                }
 
-               wfProfileOut( __METHOD__ );
                return $this->latestRev;
        }
 
@@ -290,7 +288,6 @@
                        return 0;
                }
 
-               wfProfileIn( __METHOD__ );
                if ( $this->latestRevId === null ) {
                        if ( $this->latestRev !== null ) {
                                $this->latestRevId = 
$this->latestRev->getRevisionId();
@@ -302,7 +299,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $this->latestRevId;
        }
 
@@ -346,13 +342,10 @@
         * @throws MWException
         */
        public function getBaseRevision() {
-               wfProfileIn( __METHOD__ );
-
                if ( $this->baseRev === null ) {
                        $baseRevId = $this->getBaseRevisionId();
 
                        if ( $baseRevId === false ) {
-                               wfProfileOut( __METHOD__ );
                                return null;
                        } else if ( $baseRevId === $this->getLatestRevisionId() 
) {
                                $this->baseRev = $this->getLatestRevision();
@@ -365,14 +358,12 @@
                                $this->baseRev = 
$this->entityRevisionLookup->getEntityRevision( $entityId, $baseRevId );
 
                                if ( $this->baseRev === null ) {
-                                       wfProfileOut( __METHOD__ );
                                        throw new MWException( 'Base revision 
ID not found: rev ' . $baseRevId
                                                . ' of ' . 
$entityId->getSerialization() );
                                }
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $this->baseRev;
        }
 
@@ -459,19 +450,14 @@
         * @return bool
         */
        public function hasEditConflict() {
-               wfProfileIn( __METHOD__ );
-
                if ( $this->isNew() || !$this->doesCheckForEditConflicts() ) {
-                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
                if ( !is_int( $this->getBaseRevisionId() ) || 
$this->getBaseRevisionId() == $this->getLatestRevisionId() ) {
-                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -577,8 +563,6 @@
         * Use addRequiredPermission() to check more permissions.
         */
        public function checkEditPermissions() {
-               wfProfileIn( __METHOD__ );
-
                foreach ( $this->requiredPermissions as $action ) {
                        $permissionStatus = 
$this->permissionChecker->getPermissionStatusForEntity(
                                $this->user,
@@ -592,16 +576,12 @@
                                $this->status->fatal( 'no-permission' );
                        }
                }
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
         * Checks if rate limits have been exceeded.
         */
        public function checkRateLimits() {
-               wfProfileIn( __METHOD__ );
-
                $exceeded = false;
 
                if ( $this->getUser()->pingLimiter( 'edit' ) ) {
@@ -614,8 +594,6 @@
                        $this->errorType |= self::RATE_LIMIT;
                        $this->status->fatal( 'actionthrottledtext' );
                }
-
-               wfProfileOut( __METHOD__ );
        }
 
 
@@ -661,8 +639,6 @@
         * @see    WikiPage::doEditContent
         */
        public function attemptSave( $summary, $flags, $token, $watch = null ) {
-               wfProfileIn( __METHOD__ );
-
                if ( wfReadOnly() ) {
                        throw new ReadOnlyError();
                }
@@ -681,8 +657,6 @@
                        $this->errorType |= self::TOKEN_ERROR;
                        $this->status->fatal( 'sessionfailure' );
                        $this->status->setResult( false, array( 'errorFlags' => 
$this->errorType ) );
-
-                       wfProfileOut( __METHOD__ );
                        return $this->status;
                }
 
@@ -692,8 +666,6 @@
 
                if ( !$this->status->isOK() ) {
                        $this->status->setResult( false, array( 'errorFlags' => 
$this->errorType ) );
-
-                       wfProfileOut( __METHOD__ );
                        return $this->status;
                }
 
@@ -711,8 +683,6 @@
 
                if ( !$this->status->isOK() ) {
                        $this->status->setResult( false, array( 'errorFlags' => 
$this->errorType ) );
-
-                       wfProfileOut( __METHOD__ );
                        return $this->status;
                }
 
@@ -720,8 +690,6 @@
 
                if ( !$this->status->isOK() ) {
                        $this->status->setResult( false, array( 'errorFlags' => 
$this->errorType ) );
-
-                       wfProfileOut( __METHOD__ );
                        return $this->status;
                }
 
@@ -757,7 +725,6 @@
                        $this->status->setResult( false, $value );
                }
 
-               wfProfileOut( __METHOD__ );
                return $this->status;
        }
 
@@ -862,11 +829,9 @@
         * @return bool true if an error page was shown, false if there were no 
errors to show.
         */
        public function showErrorPage( $titleMessage = null ) {
-               wfProfileIn( __METHOD__ );
                $out = $this->context->getOutput();
 
                if ( $this->status === null || $this->status->isOK() ) {
-                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
@@ -882,7 +847,6 @@
                        $out->returnToMain( '', $this->getTitle() );
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
@@ -892,11 +856,9 @@
         * @return bool true if any message was shown, false if there were no 
errors to show.
         */
        protected function showStatus( ) {
-               wfProfileIn( __METHOD__ );
                $out = $this->context->getOutput();
 
                if ( $this->status === null || $this->status->isGood() ) {
-                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
@@ -904,7 +866,6 @@
 
                $out->addHTML( Html::rawElement( 'div', array( 'class' => 
'error' ), $text ) );
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
diff --git a/repo/includes/EntityParserOutputGenerator.php 
b/repo/includes/EntityParserOutputGenerator.php
index a83129a..2ae7c8b 100644
--- a/repo/includes/EntityParserOutputGenerator.php
+++ b/repo/includes/EntityParserOutputGenerator.php
@@ -236,8 +236,6 @@
         * @return EntityInfo
         */
        private function getEntityInfo( array $entityIds ) {
-               wfProfileIn( __METHOD__ );
-
                $entityInfoBuilder = 
$this->entityInfoBuilderFactory->newEntityInfoBuilder( $entityIds );
 
                $entityInfoBuilder->resolveRedirects();
@@ -251,10 +249,7 @@
                $entityInfoBuilder->collectDataTypes();
                $entityInfoBuilder->retainEntityInfo( $entityIds );
 
-               $entityInfo = $entityInfoBuilder->getEntityInfo();
-
-               wfProfileOut( __METHOD__ );
-               return $entityInfo;
+               return $entityInfoBuilder->getEntityInfo();
        }
 
        /**
diff --git a/repo/includes/Hooks/LinkBeginHookHandler.php 
b/repo/includes/Hooks/LinkBeginHookHandler.php
index 532602c..c621ced 100644
--- a/repo/includes/Hooks/LinkBeginHookHandler.php
+++ b/repo/includes/Hooks/LinkBeginHookHandler.php
@@ -169,12 +169,9 @@
                        return;
                }
 
-               wfProfileIn( __METHOD__ );
-
                $entityId = $this->entityIdLookup->getEntityIdForTitle( $target 
);
 
                if ( !$entityId ) {
-                       wfProfileOut( __METHOD__ );
                        return;
                }
 
@@ -190,7 +187,6 @@
                        $descriptions = $this->termLookup->getDescriptions( 
$entityId, $this->languageFallback->getFetchLanguageCodes() );
                } catch ( StorageException $ex ) {
                        // This shouldn't happen if $target->exists() return 
true!
-                       wfProfileOut( __METHOD__ );
                        return;
                }
 
@@ -207,8 +203,6 @@
 
                // add wikibase styles in all cases, so we can format the link 
properly:
                $out->addModuleStyles( array( 'wikibase.common' ) );
-
-               wfProfileOut( __METHOD__ );
        }
 
        private function getPreferredTerm( $termsByLanguage ) {
diff --git a/repo/includes/Interactors/RedirectCreationInteractor.php 
b/repo/includes/Interactors/RedirectCreationInteractor.php
index 6eacde0..7cf5fa9 100644
--- a/repo/includes/Interactors/RedirectCreationInteractor.php
+++ b/repo/includes/Interactors/RedirectCreationInteractor.php
@@ -85,8 +85,6 @@
         * the failure. An explanation of the error codes can be obtained from 
getErrorCodeInfo().
         */
        public function createRedirect( EntityId $fromId, EntityId $toId, $bot 
) {
-               wfProfileIn( __METHOD__ );
-
                $this->checkCompatible( $fromId, $toId );
                $this->checkPermissions( $fromId );
 
@@ -98,8 +96,6 @@
 
                $redirect = new EntityRedirect( $fromId, $toId );
                $this->saveRedirect( $redirect, $summary, $bot );
-
-               wfProfileOut( __METHOD__ );
 
                return $redirect;
        }
diff --git a/repo/includes/LinkedData/EntityDataSerializationService.php 
b/repo/includes/LinkedData/EntityDataSerializationService.php
index 9d6d258..dc59466 100644
--- a/repo/includes/LinkedData/EntityDataSerializationService.php
+++ b/repo/includes/LinkedData/EntityDataSerializationService.php
@@ -513,8 +513,6 @@
         * @return ApiResult
         */
        protected function generateApiResult( EntityRevision $entityRevision, 
ApiFormatBase $printer ) {
-               wfProfileIn( __METHOD__ );
-
                $entityKey = 'entity'; //XXX: perhaps better: 
$entity->getType();
 
                $res = $printer->getResult();
@@ -544,7 +542,6 @@
                );
                $resultBuilder->addEntityRevision( null, $entityRevision, 
$options );
 
-               wfProfileOut( __METHOD__ );
                return $res;
        }
 
diff --git a/repo/includes/Notifications/ChangeNotifier.php 
b/repo/includes/Notifications/ChangeNotifier.php
index 9062650..8021509 100644
--- a/repo/includes/Notifications/ChangeNotifier.php
+++ b/repo/includes/Notifications/ChangeNotifier.php
@@ -47,8 +47,6 @@
         * @return EntityChange|null
         */
        public function notifyOnPageDeleted( EntityContent $content, User 
$user, $timestamp ) {
-               wfProfileIn( __METHOD__ );
-
                if ( $content->isRedirect() ) {
                        // TODO: notify the client about changes to redirects!
                        return null;
@@ -62,7 +60,6 @@
 
                $this->changeTransmitter->transmitChange( $change );
 
-               wfProfileOut( __METHOD__ );
                return $change;
        }
 
@@ -75,8 +72,6 @@
         * @return EntityChange|null
         */
        public function notifyOnPageUndeleted( Revision $revision ) {
-               wfProfileIn( __METHOD__ );
-
                /** @var EntityContent $content */
                $content = $revision->getContent();
 
@@ -96,7 +91,6 @@
 
                $this->changeTransmitter->transmitChange( $change );
 
-               wfProfileOut( __METHOD__ );
                return $change;
        }
 
@@ -112,8 +106,6 @@
         * @return EntityChange|null
         */
        public function notifyOnPageCreated( Revision $revision ) {
-               wfProfileIn( __METHOD__ );
-
                /** @var EntityContent $content */
                $content = $revision->getContent();
 
@@ -130,7 +122,6 @@
                // FIXME: RepoHooks::onRecentChangeSave currently adds to the 
change later!
                $this->changeTransmitter->transmitChange( $change );
 
-               wfProfileOut( __METHOD__ );
                return $change;
        }
 
@@ -147,8 +138,6 @@
         * @return EntityChange|null
         */
        public function notifyOnPageModified( Revision $current, Revision 
$parent ) {
-               wfProfileIn( __METHOD__ );
-
                if ( $current->getParentId() !== $parent->getId() ) {
                        throw new InvalidArgumentException( '$parent->getId() 
must be the same as $current->getParentId()!' );
                }
@@ -165,7 +154,6 @@
                // FIXME: RepoHooks::onRecentChangeSave currently adds to the 
change later!
                $this->changeTransmitter->transmitChange( $change );
 
-               wfProfileOut( __METHOD__ );
                return $change;
        }
 
diff --git a/repo/includes/UpdateRepo/UpdateRepoJob.php 
b/repo/includes/UpdateRepo/UpdateRepoJob.php
index 37ecde1..0329a7d 100644
--- a/repo/includes/UpdateRepo/UpdateRepoJob.php
+++ b/repo/includes/UpdateRepo/UpdateRepoJob.php
@@ -182,8 +182,6 @@
                        wfDebugLog( __CLASS__, __FUNCTION__ . ": attemptSave 
for " . $item->getId()->getSerialization() . " failed: " . 
$status->getMessage()->text() );
                }
 
-               wfProfileOut( __METHOD__ );
-
                return $status->isOK();
        }
 
@@ -198,7 +196,6 @@
                        // This should never happen as we check with CentralAuth
                        // that the user actually does exist
                        wfLogWarning( "User $name doesn't exist while 
CentralAuth pretends it does" );
-                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
@@ -209,7 +206,6 @@
         * @return bool success
         */
        public function run() {
-               wfProfileIn( __METHOD__ );
                $params = $this->getParams();
 
                $user = $this->getUser( $params['user'] );
@@ -223,7 +219,6 @@
                        $this->saveChanges( $item, $user );
                }
 
-               wfProfileOut( __METHOD__ );
                return true;
        }
 
diff --git a/repo/includes/UpdateRepo/UpdateRepoOnDeleteJob.php 
b/repo/includes/UpdateRepo/UpdateRepoOnDeleteJob.php
index 39ae6a1..967e764 100644
--- a/repo/includes/UpdateRepo/UpdateRepoOnDeleteJob.php
+++ b/repo/includes/UpdateRepo/UpdateRepoOnDeleteJob.php
@@ -120,7 +120,6 @@
         * @return bool
         */
        protected function verifyValid( Item $item ) {
-               wfProfileIn( __METHOD__ );
                $params = $this->getParams();
                $siteId = $params['siteId'];
                $page = $params['title'];
@@ -129,7 +128,6 @@
                if ( !$siteLink || $siteLink->getPageName() !== $page ) {
                        // Probably something changed since the job has been 
inserted
                        wfDebugLog( 'UpdateRepo', "OnDelete: The site link to " 
. $siteId . " is no longer $page" );
-                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
@@ -139,7 +137,6 @@
                $exists = $site->normalizePageName( $page );
                if ( $exists !== false ) {
                        wfDebugLog( 'UpdateRepo', "OnDelete: $page on $siteId 
exists" );
-                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
diff --git a/repo/includes/UpdateRepo/UpdateRepoOnMoveJob.php 
b/repo/includes/UpdateRepo/UpdateRepoOnMoveJob.php
index 42b333f..b409c1d 100644
--- a/repo/includes/UpdateRepo/UpdateRepoOnMoveJob.php
+++ b/repo/includes/UpdateRepo/UpdateRepoOnMoveJob.php
@@ -149,7 +149,6 @@
         * @return bool
         */
        protected function verifyValid( Item $item ) {
-               wfProfileIn( __METHOD__ );
                $params = $this->getParams();
                $siteId = $params['siteId'];
                $oldPage = $params['oldTitle'];
@@ -158,13 +157,11 @@
                if ( !$oldSiteLink || $oldSiteLink->getPageName() !== $oldPage 
) {
                        // Probably something changed since the job has been 
inserted
                        wfDebugLog( 'UpdateRepo', "OnMove: The site link to " . 
$siteId . " is no longer $oldPage" );
-                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
                // Normalize the name, just in case the page has been updated 
in the mean time
                if ( $this->getNormalizedPageName() === false ) {
-                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
diff --git a/repo/includes/Validators/SiteLinkUniquenessValidator.php 
b/repo/includes/Validators/SiteLinkUniquenessValidator.php
index bd685a4..f6a2866 100644
--- a/repo/includes/Validators/SiteLinkUniquenessValidator.php
+++ b/repo/includes/Validators/SiteLinkUniquenessValidator.php
@@ -39,7 +39,6 @@
         * @return Result
         */
        public function validateEntity( Entity $entity ) {
-               wfProfileIn( __METHOD__ );
                $dbw = wfGetDB( DB_MASTER );
 
                $conflicts = $this->siteLinkLookup->getConflictsForItem( 
$entity, $dbw );
@@ -50,14 +49,7 @@
                        $errors[] = $this->getConflictError( $conflict );
                }
 
-               if ( empty( $errors ) ) {
-                       $result = Result::newSuccess();
-               } else {
-                       $result = Result::newError( $errors );
-               }
-
-               wfProfileOut( __METHOD__ );
-               return $result;
+               return empty( $errors ) ? Result::newSuccess() : 
Result::newError( $errors );
        }
 
        /**
diff --git a/repo/includes/View/ClaimHtmlGenerator.php 
b/repo/includes/View/ClaimHtmlGenerator.php
index a446a1b..d937f38 100644
--- a/repo/includes/View/ClaimHtmlGenerator.php
+++ b/repo/includes/View/ClaimHtmlGenerator.php
@@ -70,8 +70,6 @@
         * @return string
         */
        public function getHtmlForClaim( Claim $claim, $editSectionHtml = null 
) {
-               wfProfileIn( __METHOD__ );
-
                $mainSnakHtml = $this->snakHtmlGenerator->getSnakHtml(
                        $claim->getMainSnak(),
                        false
@@ -103,7 +101,7 @@
                        $referencesHtml = '';
                }
 
-               $claimHtml = $this->templateFactory->render(
+               return $this->templateFactory->render(
                        'wikibase-statementview',
                        $claim->getGuid(),
                        $rankHtml,
@@ -113,10 +111,6 @@
                        $referencesHeading,
                        $referencesHtml
                );
-
-
-               wfProfileOut( __METHOD__ );
-               return $claimHtml;
        }
 
        /**
diff --git a/repo/includes/View/EntityTermsView.php 
b/repo/includes/View/EntityTermsView.php
index fba8325..a9af050 100644
--- a/repo/includes/View/EntityTermsView.php
+++ b/repo/includes/View/EntityTermsView.php
@@ -171,8 +171,6 @@
                Title $title = null,
                $showEntitytermslistview = false
        ) {
-               wfProfileIn( __METHOD__ );
-
                $entityTermsForLanguageViewsHtml = '';
 
                foreach( $languageCodes as $languageCode ) {
@@ -183,16 +181,13 @@
                        );
                }
 
-               $html = $this->templateFactory->render( 
'wikibase-entitytermsforlanguagelistview',
+               return $this->templateFactory->render( 
'wikibase-entitytermsforlanguagelistview',
                        $this->msg( 
'wikibase-entitytermsforlanguagelistview-language' ),
                        $this->msg( 
'wikibase-entitytermsforlanguagelistview-label' ),
                        $this->msg( 
'wikibase-entitytermsforlanguagelistview-aliases' ),
                        $this->msg( 
'wikibase-entitytermsforlanguagelistview-description' ),
                        $entityTermsForLanguageViewsHtml
                );
-
-               wfProfileOut( __METHOD__ );
-               return $html;
        }
 
        /**
diff --git a/repo/includes/View/EntityView.php 
b/repo/includes/View/EntityView.php
index 4501bbe..4159db2 100644
--- a/repo/includes/View/EntityView.php
+++ b/repo/includes/View/EntityView.php
@@ -147,17 +147,12 @@
         * @return string
         */
        protected function getMainHtml( EntityRevision $entityRevision ) {
-               wfProfileIn( __METHOD__ );
-
                $entity = $entityRevision->getEntity();
 
-               $html = $this->getHtmlForFingerprint(
+               return $this->getHtmlForFingerprint(
                        $entity,
                        $this->getHtmlForTermBox( $entityRevision )
                );
-
-               wfProfileOut( __METHOD__ );
-               return $html;
        }
 
        /**
diff --git a/repo/includes/View/PropertyView.php 
b/repo/includes/View/PropertyView.php
index c87972c..11e0cd3 100644
--- a/repo/includes/View/PropertyView.php
+++ b/repo/includes/View/PropertyView.php
@@ -58,8 +58,6 @@
         * @see EntityView::getMainHtml
         */
        public function getMainHtml( EntityRevision $entityRevision ) {
-               wfProfileIn( __METHOD__ );
-
                $property = $entityRevision->getEntity();
 
                if ( !( $property instanceof Property ) ) {
@@ -79,7 +77,6 @@
                        $html .= "\n" . $footer->parse();
                }
 
-               wfProfileOut( __METHOD__ );
                return $html;
        }
 
diff --git a/repo/includes/View/SectionEditLinkGenerator.php 
b/repo/includes/View/SectionEditLinkGenerator.php
index 5a077bc..99f8d08 100644
--- a/repo/includes/View/SectionEditLinkGenerator.php
+++ b/repo/includes/View/SectionEditLinkGenerator.php
@@ -51,20 +51,16 @@
                Message $message,
                $enabled = true
        ) {
-               wfProfileIn( __METHOD__ );
 
                $editUrl = $enabled ? $this->getEditUrl( $specialPageName, 
$specialPageUrlParams ) : null;
                $toolbarButton = $this->getToolbarButton( $cssClassSuffix, 
$message->text(), $editUrl );
 
-               $html = $this->templateFactory->render( 
'wikibase-toolbar-container',
+               return $this->templateFactory->render( 
'wikibase-toolbar-container',
                        $this->templateFactory->render( 'wikibase-toolbar',
                                '',
                                $toolbarButton
                        )
                );
-
-               wfProfileOut( __METHOD__ );
-               return $html;
        }
 
        /**
@@ -88,18 +84,13 @@
                Message $message,
                $enabled = true
        ) {
-               wfProfileIn( __METHOD__ );
-
                $editUrl = $enabled ? $this->getEditUrl( $specialPageName, 
$specialPageUrlParams ) : null;
                $toolbarButton = $this->getToolbarButton( $cssClassSuffix, 
$message->text(), $editUrl );
 
-               $html = $this->templateFactory->render(
+               return $this->templateFactory->render(
                        'wikibase-toolbar-container',
                        $toolbarButton
                );
-
-               wfProfileOut( __METHOD__ );
-               return $html;
        }
 
        /**
diff --git a/repo/includes/actions/SubmitEntityAction.php 
b/repo/includes/actions/SubmitEntityAction.php
index bf4f4f4..59601be 100644
--- a/repo/includes/actions/SubmitEntityAction.php
+++ b/repo/includes/actions/SubmitEntityAction.php
@@ -186,8 +186,6 @@
         * @return Status a status object representing the check's result.
         */
        private function getPermissionStatus( $permission, Title $title, $quick 
= '' ) {
-               wfProfileIn( __METHOD__ );
-
                //XXX: would be nice to be able to pass the $short flag too,
                //     as used by getUserPermissionsErrorsInternal. But Title 
doesn't expose that.
                $errors = $title->getUserPermissionsErrors( $permission, 
$this->getUser(), $quick !== 'quick' );
@@ -198,7 +196,6 @@
                        $status->setResult( false );
                }
 
-               wfProfileOut( __METHOD__ );
                return $status;
        }
 
diff --git a/repo/includes/api/ApiWikibase.php 
b/repo/includes/api/ApiWikibase.php
index 6848c10..fd83280 100644
--- a/repo/includes/api/ApiWikibase.php
+++ b/repo/includes/api/ApiWikibase.php
@@ -340,8 +340,6 @@
         * @throws UsageException If $status->isOK() returns false.
         */
        private function handleStatus( Status $status, $errorCode, array 
$extradata = array(), $httpRespCode = 0 ) {
-               wfProfileIn( __METHOD__ );
-
                if ( $status->isGood() ) {
                        return;
                } elseif ( $status->isOK() ) {
@@ -350,8 +348,6 @@
                        $this->errorReporter->reportStatusWarnings( $status );
                        $this->errorReporter->dieStatus( $status, $errorCode, 
$httpRespCode, $extradata );
                }
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/CreateClaim.php 
b/repo/includes/api/CreateClaim.php
index b30b222..8422bfd 100644
--- a/repo/includes/api/CreateClaim.php
+++ b/repo/includes/api/CreateClaim.php
@@ -45,8 +45,6 @@
         * @since 0.2
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                $params = $this->extractRequestParams();
                $this->validateParameters( $params );
 
@@ -78,8 +76,6 @@
                $this->saveChanges( $entity, $summary );
                $this->getResultBuilder()->markSuccess();
                $this->getResultBuilder()->addClaim( $claim );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/CreateRedirectModule.php 
b/repo/includes/api/CreateRedirectModule.php
index decfdbe..fe53264 100644
--- a/repo/includes/api/CreateRedirectModule.php
+++ b/repo/includes/api/CreateRedirectModule.php
@@ -75,8 +75,6 @@
         * @see ApiBase::execute()
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                $params = $this->extractRequestParams();
                $bot = $this->getUser()->isAllowed( 'bot' ) && $params['bot'];
 
@@ -90,8 +88,6 @@
                } catch ( RedirectCreationException $ex ) {
                        $this->handleRedirectCreationException( $ex );
                }
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/EditEntity.php b/repo/includes/api/EditEntity.php
index 8bf59e3..3181c72 100644
--- a/repo/includes/api/EditEntity.php
+++ b/repo/includes/api/EditEntity.php
@@ -151,8 +151,6 @@
         * @see ModifyEntity::modifyEntity
         */
        protected function modifyEntity( Entity &$entity, array $params, 
$baseRevId ) {
-               wfProfileIn( __METHOD__ );
-
                $this->validateDataParameter( $params );
                $data = json_decode( $params['data'], true );
                $this->validateDataProperties( $data, $entity, $baseRevId );
@@ -168,7 +166,6 @@
                                );
 
                                if ( !$baseRevId === $latestRevision ) {
-                                       wfProfileOut( __METHOD__ );
                                        $this->dieError(
                                                'Tried to clear entity using 
baserevid of entity not equal to current revision',
                                                'editconflict'
@@ -181,7 +178,6 @@
                // if we create a new property, make sure we set the datatype
                if ( !$exists && $entity instanceof Property ) {
                        if ( !isset( $data['datatype'] ) ) {
-                               wfProfileOut( __METHOD__ );
                                $this->dieError( 'No datatype given', 
'param-illegal' );
                        } else {
                                $entity->setDataTypeId( $data['datatype'] );
@@ -193,10 +189,7 @@
                $this->applyChangeOp( $changeOps, $entity );
 
                $this->buildResult( $entity );
-               $summary = $this->getSummary( $params );
-
-               wfProfileOut( __METHOD__ );
-               return $summary;
+               return $this->getSummary( $params );
        }
 
        /**
@@ -551,7 +544,6 @@
         */
        private function validateDataParameter( array $params ) {
                if ( !isset( $params['data'] ) ) {
-                       wfProfileOut( __METHOD__ );
                        $this->dieError( 'No data to operate upon', 'no-data' );
                }
        }
diff --git a/repo/includes/api/GetClaims.php b/repo/includes/api/GetClaims.php
index b92cb2f..c346b70 100644
--- a/repo/includes/api/GetClaims.php
+++ b/repo/includes/api/GetClaims.php
@@ -58,8 +58,6 @@
         * @since 0.3
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                $params = $this->extractRequestParams();
                $this->validateParameters( $params );
 
@@ -84,8 +82,6 @@
 
                $claims = $this->getClaims( $entity, $claimGuid );
                $this->getResultBuilder()->addClaims( $claims, null );
-
-               wfProfileOut( __METHOD__ );
        }
 
        private function validateParameters( array $params ) {
diff --git a/repo/includes/api/GetEntities.php 
b/repo/includes/api/GetEntities.php
index 6eeddae..2e6bd5f 100644
--- a/repo/includes/api/GetEntities.php
+++ b/repo/includes/api/GetEntities.php
@@ -74,11 +74,9 @@
         * @see ApiBase::execute()
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
                $params = $this->extractRequestParams();
 
                if ( !isset( $params['ids'] ) && ( empty( $params['sites'] ) || 
empty( $params['titles'] ) ) ) {
-                       wfProfileOut( __METHOD__ );
                        $this->dieError(
                                'Either provide the item "ids" or pairs of 
"sites" and "titles" for corresponding pages',
                                'param-missing'
@@ -100,8 +98,6 @@
                }
 
                $this->getResultBuilder()->markSuccess( 1 );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -129,7 +125,6 @@
                                try {
                                        $ids[] = $this->getIdParser()->parse( 
$id );
                                } catch( EntityIdParsingException $e ) {
-                                       wfProfileOut( __METHOD__ );
                                        $this->dieError( "Invalid id: $id", 
'no-such-entity' );
                                }
                        }
@@ -237,8 +232,6 @@
         * @param array $params
         */
        private function handleEntity( $key, EntityRevision $entityRevision = 
null, array $params = array() ) {
-               wfProfileIn( __METHOD__ );
-
                if ( $entityRevision === null ) {
                        $this->getResultBuilder()->addMissingEntity( $key, 
array( 'id' => $key ) );
                } else {
@@ -248,8 +241,6 @@
 
                        $this->getResultBuilder()->addEntityRevision( $key, 
$entityRevision, $options, $props, $siteFilterIds );
                }
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/LinkTitles.php b/repo/includes/api/LinkTitles.php
index 3b7684c..a9d1cc0 100644
--- a/repo/includes/api/LinkTitles.php
+++ b/repo/includes/api/LinkTitles.php
@@ -60,8 +60,6 @@
         * @since 0.1
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                $lookup = $this->getEntityRevisionLookup();
 
                $params = $this->extractRequestParams();
@@ -135,19 +133,16 @@
                // we can be sure that $fromId and $toId are not null here
                elseif ( $fromId->equals( $toId ) ) {
                        // no-op
-                       wfProfileOut( __METHOD__ );
                        $this->dieError( 'Common item detected, sitelinks are 
both on the same item', 'common-item' );
                }
                else {
                        // dissimilar items
-                       wfProfileOut( __METHOD__ );
                        $this->dieError( 'No common item detected, unable to 
link titles' , 'no-common-item' );
                }
 
                $this->getResultBuilder()->addSiteLinks( $return, 'entity' );
                $status = $this->getAttemptSaveStatus( $item, $summary, $flags 
);
                $this->buildResult( $item, $status );
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/MergeItems.php b/repo/includes/api/MergeItems.php
index ee7fc38..38ad1e4 100644
--- a/repo/includes/api/MergeItems.php
+++ b/repo/includes/api/MergeItems.php
@@ -111,8 +111,6 @@
         * @see ApiBase::execute()
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                $params = $this->extractRequestParams();
 
                try {
@@ -132,8 +130,6 @@
                } catch ( ItemMergeException $ex ) {
                        $this->handleItemMergeException( $ex );
                }
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/ModifyEntity.php 
b/repo/includes/api/ModifyEntity.php
index ee64fd4..c39adcf 100644
--- a/repo/includes/api/ModifyEntity.php
+++ b/repo/includes/api/ModifyEntity.php
@@ -315,8 +315,6 @@
         * @since 0.1
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                $params = $this->extractRequestParams();
                $user = $this->getUser();
                $this->flags = 0;
@@ -346,7 +344,6 @@
                $status = $this->checkPermissions( $entity, $user, $params );
 
                if ( !$status->isOK() ) {
-                       wfProfileOut( __METHOD__ );
                        $this->dieError( 'You do not have sufficient 
permissions', 'permissiondenied' );
                }
 
@@ -355,7 +352,6 @@
                if ( !$summary ) {
                        //XXX: This could rather be used for "silent" failure, 
i.e. in cases where
                        //     there was simply nothing to do.
-                       wfProfileOut( __METHOD__ );
                        $this->dieError( 'Attempted modification of the item 
failed', 'failed-modify' );
                }
 
@@ -374,8 +370,6 @@
                );
 
                $this->addToOutput( $entity, $status );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/RemoveClaims.php 
b/repo/includes/api/RemoveClaims.php
index 8cfede5..9f99724 100644
--- a/repo/includes/api/RemoveClaims.php
+++ b/repo/includes/api/RemoveClaims.php
@@ -47,8 +47,6 @@
         * @since 0.3
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                $params = $this->extractRequestParams();
                $entityId = $this->getEntityId( $params );
                $baseRevisionId = isset( $params['baserevid'] ) ? intval( 
$params['baserevid'] ) : null;
@@ -70,8 +68,6 @@
                $this->saveChanges( $entity, $summary );
                $this->getResultBuilder()->markSuccess();
                $this->getResultBuilder()->setList( null, 'claims', 
$params['claim'], 'claim' );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/RemoveQualifiers.php 
b/repo/includes/api/RemoveQualifiers.php
index c6140f2..00bd5f4 100644
--- a/repo/includes/api/RemoveQualifiers.php
+++ b/repo/includes/api/RemoveQualifiers.php
@@ -45,8 +45,6 @@
         * @since 0.3
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                $params = $this->extractRequestParams();
                $this->validateParameters( $params );
 
@@ -72,8 +70,6 @@
 
                $this->saveChanges( $entity, $summary );
                $this->getResultBuilder()->markSuccess();
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/RemoveReferences.php 
b/repo/includes/api/RemoveReferences.php
index 694d724..e580cdc 100644
--- a/repo/includes/api/RemoveReferences.php
+++ b/repo/includes/api/RemoveReferences.php
@@ -45,8 +45,6 @@
         * @since 0.3
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                $params = $this->extractRequestParams();
                $this->validateParameters( $params );
 
@@ -76,8 +74,6 @@
 
                $this->saveChanges( $entity, $summary );
                $this->getResultBuilder()->markSuccess();
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/SearchEntities.php 
b/repo/includes/api/SearchEntities.php
index c6c13a1..b774947 100644
--- a/repo/includes/api/SearchEntities.php
+++ b/repo/includes/api/SearchEntities.php
@@ -69,9 +69,7 @@
         * @return EntityId[]
         */
        private function searchEntities( $term, $entityType, $language, $limit, 
$prefixSearch ) {
-               wfProfileIn( __METHOD__ );
-
-               $ids = 
WikibaseRepo::getDefaultInstance()->getStore()->getTermIndex()->getMatchingIDs(
+               return 
WikibaseRepo::getDefaultInstance()->getStore()->getTermIndex()->getMatchingIDs(
                        array(
                                new Term( array(
                                        'termType'              => 
Term::TYPE_LABEL,
@@ -91,9 +89,6 @@
                                'LIMIT' => $limit,
                        )
                );
-
-               wfProfileOut( __METHOD__ );
-               return $ids;
        }
 
        /**
@@ -107,8 +102,6 @@
         * @return array[]
         */
        private function getSearchEntries( array $params ) {
-               wfProfileIn( __METHOD__ );
-
                $ids = array();
                $required = $params['continue'] + $params['limit'] + 1;
 
@@ -124,10 +117,7 @@
                );
                $ids = array_unique( $ids );
 
-               $entries = $this->getEntries( $ids, $params['search'], 
$params['language'] );
-
-               wfProfileOut( __METHOD__ );
-               return $entries;
+               return $this->getEntries( $ids, $params['search'], 
$params['language'] );
        }
 
        /**
@@ -258,8 +248,6 @@
         * @see ApiBase::execute()
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                $params = $this->extractRequestParams();
 
                $entries = $this->getSearchEntries( $params );
@@ -311,8 +299,6 @@
                        'success',
                        (int)true
                );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/SetAliases.php b/repo/includes/api/SetAliases.php
index 06c0ec5..845e7f9 100644
--- a/repo/includes/api/SetAliases.php
+++ b/repo/includes/api/SetAliases.php
@@ -90,8 +90,6 @@
         * @see ModifyEntity::modifyEntity
         */
        protected function modifyEntity( Entity &$entity, array $params, 
$baseRevId ) {
-               wfProfileIn( __METHOD__ );
-
                $summary = $this->createSummary( $params );
                $language = $params['language'];
 
@@ -119,7 +117,6 @@
                        $this->getResultBuilder()->addAliases( array( $language 
=> $aliases ), 'entity' );
                }
 
-               wfProfileOut( __METHOD__ );
                return $summary;
        }
 
@@ -148,7 +145,6 @@
         * @return ChangeOpAliases
         */
        private function getChangeOps( array $params ) {
-               wfProfileIn( __METHOD__ );
                $changeOps = array();
                $language = $params['language'];
 
@@ -180,7 +176,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $changeOps;
        }
 
diff --git a/repo/includes/api/SetClaimValue.php 
b/repo/includes/api/SetClaimValue.php
index 2c0bbaf..8c53a4c 100644
--- a/repo/includes/api/SetClaimValue.php
+++ b/repo/includes/api/SetClaimValue.php
@@ -41,8 +41,6 @@
         * @since 0.3
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                $params = $this->extractRequestParams();
                $this->validateParameters( $params );
 
@@ -68,8 +66,6 @@
                $this->saveChanges( $entity, $summary );
                $this->getResultBuilder()->markSuccess();
                $this->getResultBuilder()->addClaim( $claim );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/SetDescription.php 
b/repo/includes/api/SetDescription.php
index 4cd5101..f20429a 100644
--- a/repo/includes/api/SetDescription.php
+++ b/repo/includes/api/SetDescription.php
@@ -42,7 +42,6 @@
         * @see ModifyEntity::modifyEntity
         */
        protected function modifyEntity( Entity &$entity, array $params, 
$baseRevId ) {
-               wfProfileIn( __METHOD__ );
                $summary = $this->createSummary( $params );
                $language = $params['language'];
 
@@ -53,7 +52,6 @@
 
                $this->getResultBuilder()->addDescriptions( $descriptions, 
'entity' );
 
-               wfProfileOut( __METHOD__ );
                return $summary;
        }
 
@@ -63,7 +61,6 @@
         * @return ChangeOpDescription
         */
        private function getChangeOp( array $params ) {
-               wfProfileIn( __METHOD__ );
                $description = "";
                $language = $params['language'];
 
@@ -77,7 +74,6 @@
                        $op = $this->termChangeOpFactory->newSetDescriptionOp( 
$language, $description );
                }
 
-               wfProfileOut( __METHOD__ );
                return $op;
        }
 
diff --git a/repo/includes/api/SetLabel.php b/repo/includes/api/SetLabel.php
index cf2f823..56e5736 100644
--- a/repo/includes/api/SetLabel.php
+++ b/repo/includes/api/SetLabel.php
@@ -42,7 +42,6 @@
         * @see ModifyEntity::modifyEntity
         */
        protected function modifyEntity( Entity &$entity, array $params, 
$baseRevId ) {
-               wfProfileIn( __METHOD__ );
                $summary = $this->createSummary( $params );
                $language = $params['language'];
 
@@ -53,7 +52,6 @@
 
                $this->getResultBuilder()->addLabels( $labels, 'entity' );
 
-               wfProfileOut( __METHOD__ );
                return $summary;
        }
 
@@ -63,7 +61,6 @@
         * @return ChangeOpLabel
         */
        private function getChangeOp( array $params ) {
-               wfProfileIn( __METHOD__ );
                $label = "";
                $language = $params['language'];
 
@@ -77,7 +74,6 @@
                        $op = $this->termChangeOpFactory->newSetLabelOp( 
$language, $label );
                }
 
-               wfProfileOut( __METHOD__ );
                return $op;
        }
 
diff --git a/repo/includes/api/SetQualifier.php 
b/repo/includes/api/SetQualifier.php
index 3e79c96..3746c18 100644
--- a/repo/includes/api/SetQualifier.php
+++ b/repo/includes/api/SetQualifier.php
@@ -45,8 +45,6 @@
         * @since 0.3
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                $params = $this->extractRequestParams();
                $this->validateParameters( $params );
 
@@ -69,8 +67,6 @@
                $this->saveChanges( $entity, $summary );
                $this->getResultBuilder()->markSuccess();
                $this->getResultBuilder()->addClaim( $claim );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/SetReference.php 
b/repo/includes/api/SetReference.php
index f930998..0c3b922 100644
--- a/repo/includes/api/SetReference.php
+++ b/repo/includes/api/SetReference.php
@@ -49,8 +49,6 @@
         * @since 0.3
         */
        public function execute() {
-               wfProfileIn( __METHOD__ );
-
                $params = $this->extractRequestParams();
                $this->validateParameters( $params );
 
@@ -90,8 +88,6 @@
                $this->saveChanges( $entity, $summary );
                $this->getResultBuilder()->markSuccess();
                $this->getResultBuilder()->addReference( $newReference );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
diff --git a/repo/includes/api/SetSiteLink.php 
b/repo/includes/api/SetSiteLink.php
index eaf1781..6849928 100644
--- a/repo/includes/api/SetSiteLink.php
+++ b/repo/includes/api/SetSiteLink.php
@@ -76,10 +76,7 @@
         * @see ModifyEntity::modifyEntity
         */
        protected function modifyEntity( Entity &$entity, array $params, 
$baseRevId ) {
-               wfProfileIn( __METHOD__ );
-
                if ( !( $entity instanceof Item ) ) {
-                       wfProfileOut( __METHOD__ );
                        $this->dieError( "The given entity is not an item", 
"not-item" );
                }
 
@@ -104,12 +101,10 @@
                                $link = $item->getSiteLink( $linksite );
                                $this->getResultBuilder()->addSiteLinks( array( 
$link ), 'entity', array( 'url' ) );
                        } else {
-                               wfProfileOut( __METHOD__ );
                                $this->dieMessage( 'no-such-sitelink', 
$params['linktitle'] );
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $summary;
        }
 
@@ -119,10 +114,8 @@
         * @return ChangeOpSiteLink
         */
        private function getChangeOp( array $params ) {
-               wfProfileIn( __METHOD__ );
                if ( $this->shouldRemove( $params ) ) {
                        $linksite = $this->stringNormalizer->trimToNFC( 
$params['linksite'] );
-                       wfProfileOut( __METHOD__ );
                        return 
$this->siteLinkChangeOpFactory->newRemoveSiteLinkOp( $linksite );
                } else {
                        $linksite = $this->stringNormalizer->trimToNFC( 
$params['linksite'] );
@@ -130,7 +123,6 @@
                        $site = $sites->getSite( $linksite );
 
                        if ( $site === false ) {
-                               wfProfileOut( __METHOD__ );
                                $this->dieError( 'The supplied site identifier 
was not recognized' , 'not-recognized-siteid' );
                        }
 
@@ -138,7 +130,6 @@
                                $page = $site->normalizePageName( 
$this->stringNormalizer->trimWhitespace( $params['linktitle'] ) );
 
                                if ( $page === false ) {
-                                       wfProfileOut( __METHOD__ );
                                        $this->dieMessage( 'no-external-page', 
$linksite, $params['linktitle'] );
                                }
                        } else {
@@ -149,7 +140,6 @@
                                ? $this->parseSiteLinkBadges( $params['badges'] 
)
                                : null;
 
-                       wfProfileOut( __METHOD__ );
                        return 
$this->siteLinkChangeOpFactory->newSetSiteLinkOp( $linksite, $page, $badges );
                }
        }
diff --git a/repo/includes/content/EntityContent.php 
b/repo/includes/content/EntityContent.php
index b9b0065..c71475e 100644
--- a/repo/includes/content/EntityContent.php
+++ b/repo/includes/content/EntityContent.php
@@ -326,7 +326,6 @@
                        return '';
                }
 
-               wfProfileIn( __METHOD__ );
                $searchTextGenerator = new EntitySearchTextGenerator();
                $text = $searchTextGenerator->generate( $this->getEntity() );
 
@@ -334,7 +333,6 @@
                        return '';
                }
 
-               wfProfileOut( __METHOD__ );
                return $text;
        }
 
@@ -359,8 +357,6 @@
                        return $this->getRedirectText();
                }
 
-               wfProfileIn( __METHOD__ );
-
                //XXX: $ignore contains knowledge about the Entity's internal 
representation.
                //     This list should therefore rather be maintained in the 
Entity class.
                static $ignore = array(
@@ -376,10 +372,7 @@
 
                $values = self::collectValues( $data, $ignore );
 
-               $text = implode( "\n", $values );
-
-               wfProfileOut( __METHOD__ );
-               return $text;
+               return implode( "\n", $values );
        }
 
        /**
@@ -687,8 +680,6 @@
         * @return Status
         */
        public function prepareSave( WikiPage $page, $flags, $baseRevId, User 
$user ) {
-               wfProfileIn( __METHOD__ );
-
                // Chain to parent
                $status = parent::prepareSave( $page, $flags, $baseRevId, $user 
);
 
@@ -701,7 +692,6 @@
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $status;
        }
 
diff --git a/repo/includes/content/EntityContentFactory.php 
b/repo/includes/content/EntityContentFactory.php
index 924d905..d7b5490 100644
--- a/repo/includes/content/EntityContentFactory.php
+++ b/repo/includes/content/EntityContentFactory.php
@@ -258,12 +258,8 @@
         * @return Status a status object representing the check's result.
         */
        protected function getPermissionStatus( User $user, $permission, Title 
$entityPage, $quick = '' ) {
-               wfProfileIn( __METHOD__ );
                $errors = $entityPage->getUserPermissionsErrors( $permission, 
$user, $quick !== 'quick' );
-               $status = $this->getStatusForPermissionErrors( $errors );
-
-               wfProfileOut( __METHOD__ );
-               return $status;
+               return $this->getStatusForPermissionErrors( $errors );
        }
 
        /**
@@ -279,7 +275,6 @@
                        $status->setResult( false );
                }
 
-               wfProfileOut( __METHOD__ );
                return $status;
        }
 
@@ -296,13 +291,8 @@
         * @todo Move to a separate service (merge into WikiPageEntityStore?)
         */
        public function getPermissionStatusForEntityId( User $user, 
$permission, EntityId $entityId, $quick = '' ) {
-               wfProfileIn( __METHOD__ );
-
                $title = $this->getTitleForId( $entityId );
-               $status = $this->getPermissionStatus( $user, $permission, 
$title, $quick );
-
-               wfProfileOut( __METHOD__ );
-               return $status;
+               return $this->getPermissionStatus( $user, $permission, $title, 
$quick );
        }
 
        /**
@@ -318,15 +308,10 @@
         * @todo Move to a separate service (merge into WikiPageEntityStore?)
         */
        public function getPermissionStatusForEntityType( User $user, 
$permission, $entityType, $quick = '' ) {
-               wfProfileIn( __METHOD__ );
-
                $ns = $this->getNamespaceForType( $entityType );
                $dummyTitle = Title::makeTitleSafe( $ns, '/' );
 
-               $status = $this->getPermissionStatus( $user, $permission, 
$dummyTitle, $quick );
-
-               wfProfileOut( __METHOD__ );
-               return $status;
+               return $this->getPermissionStatus( $user, $permission, 
$dummyTitle, $quick );
        }
 
        /**
diff --git a/repo/includes/content/ItemContent.php 
b/repo/includes/content/ItemContent.php
index 612277e..c4d1b5a 100644
--- a/repo/includes/content/ItemContent.php
+++ b/repo/includes/content/ItemContent.php
@@ -155,12 +155,7 @@
                        throw new LogicException( 'Neither redirect nor item 
found in ItemContent!' );
                }
 
-               wfProfileIn( __METHOD__ );
-
-               $item = $this->itemHolder->getEntity( 
'Wikibase\DataModel\Entity\Item' );
-
-               wfProfileOut( __METHOD__ );
-               return $item;
+               return $this->itemHolder->getEntity( 
'Wikibase\DataModel\Entity\Item' );
        }
 
        /**
@@ -199,8 +194,6 @@
                        return '';
                }
 
-               wfProfileIn( __METHOD__ );
-
                // TODO: refactor ItemSearchTextGenerator to share an interface 
with EntitySearchTextGenerator,
                // so we don't have to re-implement getTextForSearchIndex() 
here.
                $searchTextGenerator = new ItemSearchTextGenerator();
@@ -210,7 +203,6 @@
                        return '';
                }
 
-               wfProfileOut( __METHOD__ );
                return $text;
        }
 
diff --git a/repo/includes/store/sql/WikiPageEntityStore.php 
b/repo/includes/store/sql/WikiPageEntityStore.php
index 6df642b..509e7f7 100644
--- a/repo/includes/store/sql/WikiPageEntityStore.php
+++ b/repo/includes/store/sql/WikiPageEntityStore.php
@@ -69,15 +69,11 @@
                        throw new StorageException( 'This entity already has an 
ID!' );
                }
 
-               wfProfileIn( __METHOD__ );
-
                $contentModelId = 
$this->contentFactory->getContentModelForType( $entity->getType() );
                $numericId = $this->idGenerator->getNewId( $contentModelId );
 
                //FIXME: this relies on setId() accepting numeric IDs!
                $entity->setId( $numericId );
-
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -124,11 +120,8 @@
         * @return EntityRevision
         */
        public function saveEntity( Entity $entity, $summary, User $user, 
$flags = 0, $baseRevId = false ) {
-               wfProfileIn( __METHOD__ );
-
                if ( $entity->getId() === null ) {
                        if ( ( $flags & EDIT_NEW ) !== EDIT_NEW ) {
-                               wfProfileOut( __METHOD__ );
                                throw new StorageException( Status::newFatal( 
'edit-gone-missing' ) );
                        }
 
@@ -142,7 +135,6 @@
 
                $this->dispatcher->dispatch( 'entityUpdated', $entityRevision );
 
-               wfProfileOut( __METHOD__ );
                return $entityRevision;
        }
 
@@ -160,8 +152,6 @@
         * @return int The new revision ID
         */
        public function saveRedirect( EntityRedirect $redirect, $summary, User 
$user, $flags = 0, $baseRevId = false ) {
-               wfProfileIn( __METHOD__ );
-
                $content = $this->contentFactory->newFromRedirect( $redirect );
 
                if ( !$content ) {
@@ -174,7 +164,6 @@
 
                $this->dispatcher->dispatch( 'redirectUpdated', $redirect, 
$revision->getId() );
 
-               wfProfileOut( __METHOD__ );
                return $revision->getId();
        }
 
@@ -204,14 +193,11 @@
                $flags = 0,
                $baseRevId = false
        ) {
-               wfProfileIn( __METHOD__ );
-
                $page = $this->getWikiPageForEntity( 
$entityContent->getEntityId() );
 
                if ( ( $flags & EDIT_NEW ) === EDIT_NEW ) {
                        $title = $page->getTitle();
                        if ( $title->exists() ) {
-                               wfProfileOut( __METHOD__ );
                                throw new StorageException( Status::newFatal( 
'edit-already-exists' ) );
                        }
                }
@@ -236,7 +222,6 @@
                );
 
                if ( !$status->isOK() ) {
-                       wfProfileOut( __METHOD__ );
                        throw new StorageException( $status );
                }
 
@@ -250,7 +235,6 @@
                        $revision = $page->getRevision();
                }
 
-               wfProfileOut( __METHOD__ );
                return $revision;
        }
 
@@ -299,11 +283,8 @@
         * @return bool
         */
        public function userWasLastToEdit( User $user, EntityId $id, $lastRevId 
) {
-               wfProfileIn( __METHOD__ );
-
                $revision = Revision::newFromId( $lastRevId );
                if ( !$revision ) {
-                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
@@ -324,7 +305,6 @@
                        array( 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 1 )
                );
 
-               wfProfileOut( __METHOD__ );
                return $res->current() === false; // return true if query had 
no match
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/192975
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If8874b17a00ff1d61bc74dcbc4c8d62419ba914e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>

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

Reply via email to