On Jun 25, 2:33 pm, Ben Bangert <[EMAIL PROTECTED]> wrote:

> Templates are compiled to actual Python modules, if you look in your  
> data/templates dir, you'll see the Python modules it made. Python then  
> of course compiles the modules to .pyc's, which is part of what makes  
> Mako so fast. You're running Python byte-compiled modules for  
> templates. So they're served from the compiled Python modules.

Right, Petal in perl does the same thing.

To clarify my question:

When the template is compiled into a module, does that module remain
in memory OR is it read off the pyc on the disk each time ?

I ask this, because the if-modified behavior of the modules raises a
bit of a red flag for me.

In piss-poor pseudocode-

I know this happens:

 if templatefile has new modified:
      recomplile

and that the .pyc is optimized

but...

 def include_template_1():
     read .pyc file

 def include_template_2():
     .pyc is in memory from previous use

In Perl, most modules do include_template_1.  Most of my performance
increases were from figuring out how to get include_template_2 style
compatibility.  i have one webapp that balloons to 140MB of ram
because all the templates are in-memory as perl routines -- but its
BLAZING fast.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to