summaryrefslogtreecommitdiff
path: root/maintenance/langmemusage.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2006-10-11 18:12:39 +0000
committerPierre Schmitz <pierre@archlinux.de>2006-10-11 18:12:39 +0000
commit183851b06bd6c52f3cae5375f433da720d410447 (patch)
treea477257decbf3360127f6739c2f9d0ec57a03d39 /maintenance/langmemusage.php
MediaWiki 1.7.1 wiederhergestellt
Diffstat (limited to 'maintenance/langmemusage.php')
-rw-r--r--maintenance/langmemusage.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/maintenance/langmemusage.php b/maintenance/langmemusage.php
new file mode 100644
index 00000000..d45de0e4
--- /dev/null
+++ b/maintenance/langmemusage.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Dumb program that tries to get the memory usage
+ * for each language file.
+ */
+
+/** This is a command line script */
+require_once('commandLine.inc');
+require_once('languages.inc');
+
+$langtool = new languages();
+
+if ( ! function_exists( 'memory_get_usage' ) )
+ wfDie( "You must compile PHP with --enable-memory-limit\n" );
+
+$memlast = $memstart = memory_get_usage();
+
+print 'Base memory usage: '.$memstart."\n";
+
+foreach($langtool->getList() as $langcode) {
+ require_once('languages/Language'.$langcode.'.php');
+ $memstep = memory_get_usage();
+ printf( "%12s: %d\n", $langcode, ($memstep- $memlast) );
+ $memlast = $memstep;
+}
+
+$memend = memory_get_usage();
+
+echo ' Total Usage: '.($memend - $memstart)."\n";
+?>