[albatross-users] Re: load_page_module patch

Matt Goodall matt at pollenation.net
Fri Sep 26 18:42:59 EST 2003


Andrew McNamara wrote:

>[added cc to albatross-users]
>
>  
>
>>You sent something slightly different to that.  The current Albatross
>>is just plain wrong in the way that it loads page modules.  It makes a
>>structured module space effectively flat.  It also imports the modules
>>in a way that interferes with the Python module space.
>>
>>In the past I was of the opinion that page modules should be organised
>>such that they provided a "package" under the specified module_path.
>>I mentioned my position to Andrew and he was not really sure that
>>making page modules look like a package is a good idea.
>>    
>>
>
>My concern is that both proposed solutions are fairly radical - we don't
>know all the consequences, and people won't appreciate us breaking their
>previously working scripts. I'd suggest we maintain a list of things we
>need to fix for the 2.0 release.
>
Good idea, I created the BugList wiki page:

    http://www.object-craft.com.au/projects/albatross/wiki/BugList

Only one bug so far ;-)

>In the mean time, maybe we can supply an
>alternate mixin that implements the proposed behaviour
>
That's a good solution. I don't really mind how it's managed as long as 
I can get my code base back in line with your packages.

>BTW, my objection to execfile is you lose the pre-compiled python
>byte code.
>
Perhaps we should profile some typical apps to see what the performance 
hit is like? If it's not significant then perhaps this is not worth 
worrying about.

Andrew, I think you mentioned something like a 3-4 times increase in 
page module load time which sounds really bad but is it really? CGI is 
the most likely to suffer but typically only one or two page modules 
will be loaded per request. How much of an overhead is that compared to 
loading the Python interpreter, standard Python modules, Albatross 
modules and other 3rd party modules the application uses? Gut feeling 
says it will not be that significant but I can't prove it.

>I'll have to see if I can come up with a scheme that uses
>the normal import machinery, but imports into a synthetic __pages__
>namespace or something.
>
I've already done this. It works but it feels very dirty, it's not a 
piece of code that makes you feel good ;-). I'll probably have the code 
in an email somewhere but I may have sent it to Dave already. Let me 
know if you want it again.

Cheers, Matt




More information about the Albatross-users mailing list