We can't forget that even not using $uses, when loading a Model it will construct all its links, and its link will construct all of their links, and so forth... So, anyway, you are most probably going to load each and every model by just loading a single one - even though they might have nothing to do with the request.
On Feb 18, 11:15 am, mark_story <[email protected]> wrote: > On Feb 17, 8:35 pm, Motin <[email protected]> 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
