PHP ODM BENCHMARK
This is a simple script to test the performance of PHP ODMs working with MongoDB.
To run the tests just execute this command:
php run.php mandango_doctrine.php all 10
The result includes the library bootstrap. If you want to exclude the bootstrap, just pass a four argument:
php run.php mandango_doctrine.php all 10 true
You can customize the test and the number documents the tests work with.
Please, feel free to improve the script and send pull requests, and also to add more tests.
These are the results I have in all tests with 10 documents:
test: insertSimpleDocument, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 10.272 | 12.474 | 11.792 | 9.578 | 8.754 | 8.763 | DoctrineMongo | 0.273 | 37.607 | 38.477 | 37.390 | 37.717 | 37.320 | 37.130 | test: updateSimpleDocument, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 13.157 | 12.663 | 12.418 | 13.788 | 12.859 | 14.056 | DoctrineMongo | 0.262 | 50.152 | 50.424 | 50.001 | 49.583 | 49.498 | 51.252 | test: updateSimpleDocumentGroup, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 10.564 | 9.773 | 11.398 | 10.519 | 11.274 | 9.858 | DoctrineMongo | 0.243 | 43.493 | 43.459 | 43.069 | 44.230 | 43.243 | 43.465 | test: deleteSimpleDocument, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 12.560 | 12.963 | 12.499 | 12.551 | 12.820 | 11.967 | DoctrineMongo | 0.278 | 45.101 | 45.083 | 44.930 | 44.702 | 45.520 | 45.270 | test: deleteSimpleDocumentGroup, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 10.649 | 10.501 | 10.865 | 10.989 | 10.270 | 10.619 | DoctrineMongo | 0.245 | 43.404 | 43.281 | 42.997 | 42.094 | 43.680 | 44.967 | test: hydrateSimpleDocument, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 10.620 | 10.587 | 10.198 | 10.696 | 10.667 | 10.950 | DoctrineMongo | 0.258 | 41.222 | 40.988 | 40.994 | 41.365 | 40.976 | 41.787 | test: insertComplexDocument, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 31.416 | 31.500 | 31.769 | 31.297 | 31.165 | 31.349 | DoctrineMongo | 0.410 | 76.618 | 78.616 | 76.541 | 75.595 | 75.984 | 76.355 | test: insertComplexDocumentMinimum, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 14.210 | 14.019 | 14.268 | 14.732 | 14.132 | 13.899 | DoctrineMongo | 0.271 | 52.399 | 52.309 | 53.397 | 52.363 | 52.130 | 51.798 | test: updateComplexDocument, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 18.852 | 18.750 | 18.736 | 19.005 | 19.142 | 18.629 | DoctrineMongo | 0.212 | 88.932 | 77.517 | 81.530 | 125.544 | 79.049 | 81.022 | test: updateComplexDocumentGroup, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 15.990 | 16.741 | 16.043 | 15.347 | 16.378 | 15.440 | DoctrineMongo | 0.195 | 82.203 | 85.714 | 82.722 | 83.692 | 74.534 | 84.353 | test: deleteComplexDocument, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 19.703 | 24.398 | 18.760 | 18.807 | 18.143 | 18.405 | DoctrineMongo | 0.236 | 83.651 | 105.140 | 104.960 | 103.751 | 104.405 | 0.000 | test: deleteComplexDocumentGroup, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 16.553 | 16.689 | 16.968 | 16.611 | 16.698 | 15.797 | DoctrineMongo | 0.208 | 79.720 | 103.461 | 73.050 | 72.952 | 72.544 | 76.591 | test: hydrateComplexDocument, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 31.975 | 55.332 | 26.053 | 26.172 | 25.902 | 26.417 | DoctrineMongo | 0.435 | 73.558 | 122.840 | 61.721 | 59.655 | 60.392 | 63.180 | test: hydrateComplexDocumentQueryCache2Fields, nb: 10 | rel | avg | 1 | 2 | 3 | 4 | 5 | |------------|------------|------------|------------|------------|------------|------------| Mandango | 1.000 | 16.392 | 15.623 | 17.429 | 16.007 | 16.578 | 16.325 | DoctrineMongo | 0.278 | 58.980 | 59.607 | 58.513 | 60.663 | 57.903 | 58.214 |