Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F31687878
raw.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Krinkle
Mar 17 2020, 9:28 PM
2020-03-17 21:28:24 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
raw.txt
View Options
<?php
define( 'MW_NO_SESSION', 1 );
require_once __DIR__ . '/../multiversion/MWMultiVersion.php';
require MWMultiVersion::getMediaWiki( 'includes/WebStart.php' );
header( 'Content-Type: text/plain; charset=utf-8' );
function kfFmtBytes($num) {
if ($num < 1024) {
return $num . 'B';
}
$num /= 1024;
if ($num < 1024) {
return round($num) . 'KB';
}
$num /= 1024;
if ($num < 1024) {
return round($num) . 'MB';
}
$num /= 1024;
if ($num < 1024) {
return round($num) . 'GB';
}
}
function kfDumpStuff(string $section) {
$oc = opcache_get_status();
$ac = apcu_sma_info();
$out = '
Opcache is enabled: '.(int)$oc['opcache_enabled'].'
Opcache is full: '.(int)$oc['cache_full'].'
Opcache memory used: '.kfFmtBytes($oc['memory_usage']['used_memory']).'
Opcache memory free: '.kfFmtBytes($oc['memory_usage']['free_memory']).'
Opcache strings mem used: '.kfFmtBytes($oc['interned_strings_usage']['used_memory']).'
Opcache strings mem free: '.kfFmtBytes($oc['interned_strings_usage']['free_memory']).'
APCu mem used: '.kfFmtBytes($ac['seg_size']).'
APCu mem free: '.kfFmtBytes($ac['avail_mem']).'
';
echo "\n### $section\n";
echo trim($out) . "\n\n";
}
kfDumpStuff('Initial');
$files = array_merge(
glob("/srv/mediawiki/php-1.35.0-wmf.22/cache/l10n/*.php"),
glob("/srv/mediawiki/php-1.35.0-wmf.23/cache/l10n/*.php")
);
if (!$files)
die('No files found.');
echo 'Found ' . count($files) . " files.\n";
$chunks = array_chunk($files, 10);
echo 'Created ' . count($chunks) . " chunks of 10 files each.\n\n";
foreach (
$chunks
as
$i => $chunk
) {
echo "Loading:\n";
foreach ($chunk as $file) {
echo " * $file\n";
opcache_compile_file($file) or die("Failed to compile: $file");
}
kfDumpStuff('After chunk #' . $i);
if ( $i > 10 ) {
break;
}
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8354198
Default Alt Text
raw.txt (1 KB)
Attached To
Mode
P10713 l10n-php opcache stats (T99740)
Attached
Detach File
Event Timeline
Log In to Comment