Created
December 28, 2014 09:25
-
-
Save SchumacherFM/7fa66882520c3ccffaa4 to your computer and use it in GitHub Desktop.
Magento2 Dependency Injection Speed Tester
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<pre><?php | |
// call via http://mage2.dev/DISpeedTest.php | |
// change settings in app/etc/config.php | |
require('app/autoload.php'); | |
Zend_Debug::dump(ini_get('memory_limit')); // should be > 1536MB | |
$start = microtime(true); | |
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); | |
for ($i = 0; $i < 100; $i++) { | |
$om = $bootstrap->getObjectManager(); | |
$om = null; | |
$bootstrap->unsetObjectManager(); // must be implemented by yourself in Magento\Framework\App\Bootstrap.php | |
} | |
printf( | |
"\nDuration for %s: %.6f secs\n", | |
$bootstrap->getObjectManager()->get('Magento\Framework\App\DeploymentConfig')->get('definition/format'), | |
microtime(true) - $start | |
); | |
echo "\nDone\n"; | |
//$scripts = opcache_get_status(true); | |
//foreach($scripts['scripts'] as $script){ | |
// echo $script['full_path']."\n"; | |
// if( | |
// strstr($script['full_path'],'DISpeedTest')!==false || | |
// strstr($script['full_path'],'definitions.php')!==false | |
// ){ | |
// Zend_Debug::dump($script); | |
// } | |
//} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment