Page MenuHomePhabricator
Paste P8629

Instrument generateLocalAutoload.php for T225730
ActivePublic

Authored by Krinkle on Jun 18 2019, 7:51 PM.
diff --git a/maintenance/generateLocalAutoload.php b/maintenance/generateLocalAutoload.php
index 19b7ee5a87..dca2574429 100644
--- a/maintenance/generateLocalAutoload.php
+++ b/maintenance/generateLocalAutoload.php
@@ -7,6 +7,8 @@ if ( PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg' ) {
require_once __DIR__ . '/../includes/AutoLoader.php';
require_once __DIR__ . '/../includes/utils/AutoloadGenerator.php';
+tideways_enable( TIDEWAYS_FLAGS_CPU | TIDEWAYS_FLAGS_MEMORY | TIDEWAYS_FLAGS_NO_BUILTINS );
+
// Mediawiki installation directory
$base = dirname( __DIR__ );
@@ -20,3 +22,12 @@ file_put_contents(
$fileinfo['filename'],
$generator->getAutoload( 'maintenance/generateLocalAutoload.php' )
);
+
+
+$data = tideways_disable();
+$mapped = array_map(function ($entry) { return $entry['wt']; }, $data);
+arsort($mapped);
+foreach($mapped as $method => $wt) {
+ echo "* $method (wt: " . number_format(floor($wt / 1000)) . " ms; ct: {$data[$method]['ct']})\n";
+}