#PHP vs PHP-CPP vs HHVM-HNI This is a small benchmark with the objective of compare the performance of PHP-CPP vs HNI.
$a = [
'key' => 'foo',
'foo' => null,
'a' => 2,
'b' => 2.2,
'c' => ['foo' => 2],
'd' => ['foo']
];
for($i=0;$i<100000;$i++) {
bson_decode(bson_encode($a));
}
The code was executed in three setups at the same system.
Under PHP 5.5.10 with 1.5.1 mongo extension, the native extension don't use libbson so the implementation is very different from the other two.
real 0m0.214s
Under HHVM 3.01 with bson-hni extension, basicaly is a wrapper of libbson
real 0m0.504s
Under the same PHP version of the native one with the bson-php-cpp extension, the same bson-hni code ported to PHP-CPP
real 0m1.815s
Can you please interpret this real 0m0.214s?