Open motin opened 8 years ago
There was an old discussion on the subject (#478), but it did not include the ORMs above that were found faster than Propel.
Another benchmark (https://github.com/Big-Shark/forked-php-orm-benchmark): Results updated 2015-12-08:
Library | Insert | findPk | complex | hydrate | with | memory usage | time |
---|---|---|---|---|---|---|---|
PDO | 49 | 45 | 0 | 33 | 92 | 775,264 | 0.22 |
LessQL | 153 | 154 | 0 | 114 | 135 | 5,232,880 | 0.57 |
YiiM | 211 | 138 | 0 | 79 | 201 | 9,961,472 | 0.67 |
YiiMWithCache | 217 | 148 | 0 | 88 | 222 | 9,961,472 | 0.71 |
Yii2M | 603 | 338 | 0 | 187 | 252 | 14,155,776 | 1.46 |
Yii2MArrayHydrate | 585 | 327 | 0 | 120 | 220 | 14,155,776 | 1.31 |
Yii2MScalarHydrate | 571 | 321 | 0 | 105 | 102 | 14,155,776 | 1.17 |
Propel20 | 218 | 105 | 0 | 263 | 323 | 10,747,904 | 0.98 |
Propel20WithCache | 156 | 68 | 0 | 228 | 261 | 10,747,904 | 0.77 |
Propel20FormatOnDemand | 151 | 67 | 0 | 221 | 264 | 11,010,048 | 0.76 |
DoctrineM | 252 | 280 | 0 | 342 | 193 | 17,301,504 | 1.55 |
DoctrineMWithCache | 266 | 272 | 0 | 332 | 189 | 17,039,360 | 1.54 |
DoctrineMArrayHydrate | 263 | 282 | 0 | 226 | 141 | 17,825,792 | 1.35 |
DoctrineMScalarHydrate | 242 | 292 | 0 | 192 | 123 | 17,825,792 | 1.25 |
DoctrineMWithoutProxies | 243 | 266 | 0 | 253 | 251 | 16,777,216 | 1.43 |
Eloquent | 419 | 254 | 0 | 126 | 218 | 11,534,336 | 1.09 |
EloquentWithoutEvent | 380 | 260 | 0 | 124 | 232 | 11,534,336 | 1.06 |
Library | Insert | findPk | complex | hydrate | with | memory usage | time |
---|---|---|---|---|---|---|---|
PDO | 54 | 30 | 0 | 37 | 92 | 783,680 | 0.23 |
LessQL | 165 | 194 | 0 | 78 | 135 | 10,316,584 | 0.66 |
YiiM | 333 | 194 | 0 | 81 | 494 | 7,267,424 | 1.33 |
YiiMWithCache | 337 | 191 | 0 | 81 | 465 | 7,286,040 | 1.30 |
Yii2M | 722 | 272 | 0 | 103 | 175 | 9,025,400 | 1.90 |
Yii2MArrayHydrate | 702 | 273 | 0 | 100 | 165 | 9,033,272 | 1.83 |
Yii2MScalarHydrate | 700 | 291 | 0 | 90 | 70 | 8,997,160 | 1.74 |
Propel20 | 545 | 169 | 0 | 771 | 512 | 9,740,696 | 2.30 |
Propel20WithCache | 481 | 135 | 0 | 736 | 485 | 9,807,688 | 2.14 |
Propel20FormatOnDemand | 479 | 128 | 0 | 675 | 463 | 9,822,696 | 2.05 |
DoctrineM | 634 | 647 | 0 | 1009 | 342 | 19,639,560 | 5.11 |
DoctrineMWithCache | 624 | 674 | 0 | 1047 | 339 | 19,635,128 | 5.07 |
DoctrineMArrayHydrate | 629 | 642 | 0 | 804 | 249 | 18,447,232 | 4.73 |
DoctrineMScalarHydrate | 618 | 634 | 0 | 747 | 203 | 17,366,336 | 4.55 |
DoctrineMWithoutProxies | 620 | 629 | 0 | 849 | 357 | 19,402,032 | 4.85 |
Eloquent | 589 | 273 | 0 | 98 | 203 | 14,652,488 | 1.53 |
EloquentWithoutEvent | 547 | 264 | 0 | 99 | 206 | 14,572,112 | 1.45 |
Library | Insert | findPk | complex | hydrate | with | memory usage | time |
---|---|---|---|---|---|---|---|
PDO | 38 | 36 | 0 | 33 | 86 | 1,720,432 | 0.20 |
LessQL | 80 | 80 | 0 | 64 | 80 | 10,109,208 | 0.32 |
YiiM | 128 | 76 | 0 | 53 | 147 | 6,291,456 | 0.45 |
YiiMWithCache | 109 | 73 | 0 | 50 | 150 | 6,291,456 | 0.42 |
Yii2M | 246 | 125 | 0 | 75 | 113 | 8,388,608 | 0.64 |
Yii2MArrayHydrate | 233 | 128 | 0 | 63 | 104 | 8,388,608 | 0.60 |
Yii2MScalarHydrate | 235 | 119 | 0 | 50 | 50 | 8,388,608 | 0.51 |
Propel20 | 142 | 74 | 0 | 163 | 190 | 6,291,456 | 0.63 |
Propel20WithCache | 86 | 41 | 0 | 124 | 141 | 6,291,456 | 0.44 |
Propel20FormatOnDemand | 85 | 43 | 0 | 118 | 138 | 6,291,456 | 0.44 |
DoctrineM | 120 | 150 | 0 | 189 | 122 | 16,777,216 | 0.97 |
DoctrineMWithCache | 118 | 146 | 0 | 194 | 112 | 16,777,216 | 0.96 |
DoctrineMArrayHydrate | 121 | 144 | 0 | 146 | 85 | 16,777,216 | 0.90 |
DoctrineMScalarHydrate | 118 | 235 | 0 | 183 | 91 | 16,777,216 | 1.01 |
DoctrineMWithoutProxies | 120 | 151 | 0 | 170 | 190 | 16,777,216 | 1.06 |
Eloquent | 209 | 137 | 0 | 84 | 137 | 8,388,608 | 0.65 |
EloquentWithoutEvent | 221 | 148 | 0 | 85 | 144 | 8,388,608 | 0.66 |
Propel will for sure be perf optimzed but first the featureset itself needs to be completed.
Does anyone know if YII and Eloquent do lazy loading here? https://github.com/kenjis/php-orm-benchmark/blob/master/fuel/app/classes/controller/orm/yii2.php#L37 and https://github.com/kenjis/php-orm-benchmark/blob/master/fuel/app/classes/controller/orm/eloquent.php#L36.
@marcj yes, both
Real lazy loading or are they eager loaded relations through configuration?
@marcj It's really lazy loading
Interesting, then we should look what the hell we're doing currently wrong. :) I guess some caches aren't hit or we load too much eager.
@maikg I think we should not pay attention to this test, it shows the speed initialization propel, and performed only 2 queries
@Big-Shark @marcj Agree that is more important to pay attention to the second benchmark, which performs the following:
It gives a better albeit far from perfect idea of how Propel2 performs in real world applications.
Is this still relevant, is there anythign that can be done here as action points or can it be closed?
According to a recent benchmark, Propel2 does not perform well in the most basic conditions when compared to other popular ORMs:
The executed code that took almost 37 ms to execute was:
This should be reduced so that Propel 2 remains competitive in simple benchmarks like the one mentioned above.