If I recall correctly, from my testing, the model is only really loaded once 
the first time the app is accessed. So Massimo is correct that loading is 
not the issue. The issue is that the model needs to be executed for every 
request, so breaking your models up will really help with this. Also, you 
may be able to throw a couple of performance tricks in there by 
conditionally loading tables based on the request object.

For example, if you have a 'contact' table that needs to be shared between 
the 'mail' and the 'address_book' controllers, then instead of making it 
global, you could do something like this in the model:

if request.controller == 'mail' or request.controller == 'address_book':
    db.define_table('contact',
        Field('name'),
        ....
    )

So if you have a 100 controllers, but only two or three need access to a 
table, then this should speed things up.

Reply via email to