> And you are right with bindModel function. When I removed
> hasAndBelongsToMany association from one of my model and binded it in
> action function del() $model->del() function didn't remove associations
> from DB.
I've been in a similar situation. I'm building an app that has around 30
models and was suffering from really slow performance. Some time ago I
removed most of the associations from the models and built them dynamically
using bindModel() where needed. The thing to really watch out for are models
that become recursive when loading--models that each have associations with
one another. For example, I've got an Event model and a Space model. An
Event belongsTo a Space and a Space hasMany Events. I've also go a whole
bunch more associations that are linked to both those models. The problem
lies in the fact that the relationship between the two is created over and
over again at several depths in the association tree. So what I've done is
eliminated the associations for these models in particular (Event and Space)
so that the common associations don't keep loading recursively. This has
helped tremendously.

Nate's right, you lose a lot of magic when you do this and end up doing a
lot of things manually, but the performance gains are worth it in my
opinion.

Another thing to consider is the platform that you're developing on. I've
been developing and planning on deploying on OSX. After being very
dissatisfied with the performance on the Xserve, even with the caching
software, etc. installed, I decided to try it out on a FreeBSD box, and
that's made such a big difference that the client decided to switch
platforms. We saw performance increases of 3-10 times on the FreeBSD box vs
the higher-speced Xserve (faster processor and more memory).


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to