Just as a learning practice, i made this port of pimple for hack, this are the results of my little benchmarks based on 1 million of iterations.
<?hh
require_once __DIR__.'/src/Pimple.php';
$container = new Pimple();
$container['raw'] = new ArrayObject();
$container['shared'] = function ($c) {
return new ArrayObject();
};
$container['factory'] = $container->factory(function ($c) {
return new ArrayObject();
});
for($i=0;$i < 1000000;$i++) {
$raw = $container['raw'];
$shared = $container['shared'];
$factory = $container['factory'];
}
time hhvm bench.php
real 0m1.729s
user 0m1.664s
sys 0m0.056s
time hhvm bench.php
real 0m2.458s
user 0m2.412s
sys 0m0.040s
time php bench.php
real 0m4.753s
user 0m4.744s
sys 0m0.000s
Could you benchmark with PHP5.4 and PHP5.5 ???