summaryrefslogtreecommitdiff
path: root/maintenance/langmemusage.php
blob: d45de0e4e6d6f3155f92c42d9bd4a00018b5628c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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";
?>