summaryrefslogtreecommitdiff
path: root/maintenance/language/langmemusage.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/language/langmemusage.php')
-rw-r--r--maintenance/language/langmemusage.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/maintenance/language/langmemusage.php b/maintenance/language/langmemusage.php
new file mode 100644
index 00000000..974bb0d8
--- /dev/null
+++ b/maintenance/language/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(dirname(__FILE__).'/../commandLine.inc');
+require_once(dirname(__FILE__).'/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->getLanguages() as $langcode ) {
+ require_once( Language::getClassFileName( $langcode ) );
+ $memstep = memory_get_usage();
+ printf( "%12s: %d\n", $langcode, ($memstep- $memlast) );
+ $memlast = $memstep;
+}
+
+$memend = memory_get_usage();
+
+echo ' Total Usage: '.($memend - $memstart)."\n";
+?>