On Feb 17, 8:35 pm, Motin <fredrik.mo...@gmail.com> wrote: > CakePHP does have some issues with aggressive loading, and have > terrible performance in a lot of areas, but that benchmark, doesn't > really measure anything regarding to Yii. Because of Yii's lazy > loading, practically none of the commonly used objects/classes are > loaded in the test application. This makes it practically the same as > barebones PHP. However, in a real application, when the helpers and > models are actually used (and thus loaded), I think the results would > look much different. > > Also, CakePHP is meant to be run with a non-file-based cache engine + > a php accelerator. > > Still, I believe that Yii is much faster for slimmed down > applications, and I really hope that CakePHP can learn something from > the lazy loading parts (why on earth does Cake load _all_ models in > $uses on each request - instead of when they are actually used? for > instance). >
Well PHP4 is one reason. Lazy loading doesn't work so well in PHP4, also using $uses is known to cause performance issues as you end up loading far too many models. You ask about why cake doesn't lazy load, but by using $uses you are doing the opposite of lazy loading. $uses is probably the most aggressive loading strategy you can implement. Using Controller::loadModel() or ClassRegistry::init() is a more _lazy_ approach. -Mark --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---