From 1c268c87a321fb6e52021ae7003f08336836cad7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Mon, 19 Sep 2011 11:05:10 +0000 Subject: [PATCH] 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. --- includes/DefaultSettings.php | 1 + includes/GlobalFunctions.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 27c88f1100..b9a6776c56 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -4006,6 +4006,7 @@ $wgShowDebug = false; /** * Prefix debug messages with relative timestamp. Very-poor man's profiler. + * Since 1.19 also includes memory usage. */ $wgDebugTimestamps = false; diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 98331dad70..4a722b5865 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -756,8 +756,8 @@ function wfDebugTimer() { } else { $prefix = sprintf( "%6.4f", microtime( true ) - $start ); } - - return $prefix . ' '; + $mem = sprintf( "%5.1fM", ( memory_get_usage( true ) / (1024*1024) ) ); + return "$prefix $mem " ; } /** -- 2.20.1