Skip to content

Instantly share code, notes, and snippets.

@weaverryan
Created March 24, 2011 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weaverryan/884439 to your computer and use it in GitHub Desktop.
Save weaverryan/884439 to your computer and use it in GitHub Desktop.
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