Don't load all models at startup

2006-06-08 Thread Gonçalo Marrafa

Hi.

Is there a way of not loading all models automatically at the bootstrap?

As far as i can tell by looking at the code, all models are automatically
loaded in the bootstrap process. I can see the advantages of this, since
we don't have to care about loading them ourselves.

The thing is that in the app i'm building i will have over 200 models! At
each page request i will use half-a-dozen at most and, nevertheless, all
200 will be loaded!

Perhaps only the models used by the requested controller should be loaded
no? Is there something i'm missing?

Thanks in advance.

-- 
Gonçalo Marrafa [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Don't load all models at startup

2006-06-08 Thread Felix Geisendörfer




Hi Gonalo,

I've looked at the code and I think I can confirm this behavior, of all
Model files being included, so I kind of support
this request. But may I ask what the heck you are working on?? 200
Models? That sounds just straight out crazy,
not even big systems like drupal/typo3/mamob/etc. do have that many
tables. I can hardly see why anybody would
use more then ~70 tables in a project (and that's kinda big already).
But maybe I've just never seen a project as big,
so sorry for my curiosity ... ; ).

Felix Geisendrfer aka the_undefined
--
http://www.thinkingphp.org
http://www.fg-webdesign.de



Gonalo Marrafa schrieb:

  Hi.

Is there a way of not loading all models automatically at the bootstrap?

As far as i can tell by looking at the code, all models are automatically
loaded in the bootstrap process. I can see the advantages of this, since
we don't have to care about loading them ourselves.

The thing is that in the app i'm building i will have over 200 models! At
each page request i will use half-a-dozen at most and, nevertheless, all
200 will be loaded!

Perhaps only the models used by the requested controller should be loaded
no? Is there something i'm missing?

Thanks in advance.

  


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---





Re: Don't load all models at startup

2006-06-08 Thread Gonçalo Marrafa

On Thu, 08 Jun 2006 13:12:08 +0200
Felix Geisendörfer [EMAIL PROTECTED] wrote:

 But may I ask what the heck you are working on?? 200 
 Models? That sounds just straight out crazy

We're (re)building a university's integrated information system. Our
current database has 237 tables, although some of them are many-to-many
relation join tables.

-- 
Gonçalo Marrafa [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Don't load all models at startup

2006-06-08 Thread nate

http://groups.google.com/group/cake-php/msg/0ea232e941449914

I'm guessing the performance part is your biggest concern here, so just
read the part of the message after (2).


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Don't load all models at startup

2006-06-08 Thread [EMAIL PROTECTED]

nate wrote:
 I'm guessing the performance part is your biggest concern here, so just
 read the part of the message after (2).

You got it! However small the performance impact is, i still think it
would make much more sense to only load needed models. In a server
serving over 7000 users, with peak rates of hundreds of simultaneous
users, even with code accelarators, the server load certainly impacts.
And, for what i can see, it's not that big of a change, so...

Regards.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---