Mongofill\Benchmarks\BsonEvent
Method Name Iterations Average Time Ops/second
------------------- ------------ -------------- -------------
simpleEncode : [10,000 ] [0.0000005092382] [1,963,717.40250]
simpleNestedEncode : [10,000 ] [0.0000507833719] [19,691.48487]
complexEncode : [10,000 ] [0.0000015980959] [625,744.67768]
complexNestedEncode: [10,000 ] [0.0001292291880] [7,738.18992]
simpleDecode : [10,000 ] [0.0000009249926] [1,081,089.77498]
Mongator is a simple MongoDB ODM to claims to be 3x faster than Doctrine, now thanks to Mongofill a pure PHP implementation of MongoDB driver, is possible run this package under HHVM.
The benchmarks, are based on athletic.
The native version uses the standard mongo driver, and HHVM is running the lastest mastver version with Mongofill ae5c155 + bson-hni 0.0.1
A bencmarks of a plain version of mongofill can be found at https://gist.github.com/mcuadros/9551290
Doctrine\Benchmarks\InsertingEvent
Method Name Iterations Average Time Ops/second
--------------------- ------------ -------------- -------------
simpleDocument : [400 ] [0.0039921021461] [250.49459]
complexDocument : [400 ] [0.0344979619980] [28.98722]
complexNestedDocument: [400 ] [0.5473231738806] [1.82707]
void bsonToMongoId(bson_iter_t* iter, Array* output) {
const bson_oid_t* oid = bson_iter_oid(iter);
char id[25];
bson_oid_to_string(oid, id);
TypedValue ret;
Class* cls = Unit::loadClass(s_MongoId.get());
ObjectData* obj = ObjectData::newInstance(cls);
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 | |
type Example = (function(): string); | |
function main() { | |
$callback = function() { | |
return 'foo'; | |
}; |
Para facilitar a un poco la consulta de fuentes y referencias usado para la creación de esta charla, he decido crear este pequeño gist.
- Doctrine Benchmark HHVM vs PHP
- Diver MongoDB para HHVM - Mongofill usado en el benchmark
PHP 5.4.12 (cli) (built: Mar 8 2013 11:16:05)
Method heredoc 1000000 iterations in 1.970294 secs
$var = <<<EOT
<html><head><title>Benchmark Test Page</title></head><body bgcolor=
"$bgcolor" text="$textcolor" {$foo->bar()} link="$link"><p><font face="$fontface"
size="$fontsize"> Here is some test text for the web page.</font>