r97465 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97464‎ | r97465 | r97466 >
Date:11:05, 19 September 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Committed a polished local hack I've been using.
At times useful to see if something is hogging much memory.
Didn't really want to add a new global for this.
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -756,8 +756,8 @@
757757 } else {
758758 $prefix = sprintf( "%6.4f", microtime( true ) - $start );
759759 }
760 -
761 - return $prefix . ' ';
 760+ $mem = sprintf( "%5.1fM", ( memory_get_usage( true ) / (1024*1024) ) );
 761+ return "$prefix $mem " ;
762762 }
763763
764764 /**
Index: trunk/phase3/includes/DefaultSettings.php
@@ -4006,6 +4006,7 @@
40074007
40084008 /**
40094009 * Prefix debug messages with relative timestamp. Very-poor man's profiler.
 4010+ * Since 1.19 also includes memory usage.
40104011 */
40114012 $wgDebugTimestamps = false;
40124013

Status & tagging log