Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
very messy autoloader benchmark
require_once 'app/autoload.php';
$classes = array(
'Acme\\FakeBundle',
'Zend_Log',
'Zend_Fake_class',
'Symfony\\Component\\HttpFoundation\\Response',
'Symfony\\Bundle\\DoctrineBundle',
'Acme\\HelloBundle\\AcmeHelloBundle',
'Doctrine\\Foo',
'Doctrine\\Bar',
);
$start = microtime(true);
$limit = 10000;
for ($i = 0; $i < $limit; $i++) {
foreach ($classes as $class) {
class_exists($class.$i);
}
}
$duration = microtime(true) - $start;
var_dump($duration);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.