r83377 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83376‎ | r83377 | r83378 >
Date:09:51, 6 March 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Speed and memory improvements to Special:LangugeStats
Modified paths:
  • /trunk/extensions/Translate/specials/SpecialLanguageStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/specials/SpecialLanguageStats.php
@@ -213,6 +213,8 @@
214214 $out .= $this->makeGroupGroup( $item, $cache );
215215 }
216216
 217+ $cache->commit();
 218+
217219 if ( $out ) {
218220 $out = $this->createHeader( $code ) ."\n" . $out;
219221 $out .= Xml::closeElement( 'table' );
@@ -325,7 +327,8 @@
326328
327329 // Initialise messages.
328330 $collection = $group->initCollection( $code );
329 - $collection->setInFile( $group->load( $code ) );
 331+ // Takes too much memory and only hides inconsistent import state
 332+ #$collection->setInFile( $group->load( $code ) );
330333 $collection->filter( 'ignored' );
331334 $collection->filter( 'optional' );
332335 // Store the count of real messages for later calculation.
@@ -344,10 +347,11 @@
345348 $cache->set( $group->getId(), $code, $result );
346349
347350 static $i = 0;
348 - if ( $i++ % 50 === 0 ) {
 351+ if ( $i++ % 10 === 0 ) {
349352 $cache->commit();
350353 }
351354
 355+ unset( $collection );
352356 wfProfileOut( __METHOD__ );
353357
354358 return $result;

Status & tagging log