Re: Slow templates in py2exe

Aahz <[email protected]> Thu, 17 Sep 2009 17:21:42 -0700
Newsgroups gmane.comp.python.cheetah
Organization The Cat & Dragon
Message-ID <[email protected]>
On Thu, Sep 17, 2009, R. Tyler Ballance wrote:
> On Thu, 17 Sep 2009, Aahz wrote:
>> 
>> Cheetah 2.0.1, Python 2.6, CherryPy 3.1.1
> 
> Old Cheetah is Old ;)
> (current is v2.2.2)

Yes, I know -- but particularly after your response, I kinda doubt that
version is the issue.  ;-)

>> I'm having a weird problem where Cheetah templates on Windows XP (and
>> probably Vista, but haven't tested yet) are more than a hundred times
>> slower inside an app built with py2exe.  This slowdown is not observed
>> with either raw or compiled templates run from outside the build, and Mac
>> built with py2app also works fine.
> 
> My initial instinct is that py2exe is pulling in the Python version of
> the NameMapper, which is indeed slower than the C version. The
> NameMapper is what is responsible for mapping $myVar into the actual
> entity that it represents.
> 
> Do you have the compiled version of NameMapper installed? Do you know if
> py2exe is pulling it in?

Curioser and curioser, as Alice said.  AFAICT, there isn't any
_namemapper.pyd anywhere on the system.  (There's a _namemapper.so on my
Mac.)  There doesn't seem to be an official pyd for 2.6, should I use
http://feisley.com/python/cheetah/pyd2.2.1/py26/_namemapper.pyd
?

What are the chances that it will work with Cheetah 2.0.1?  (I'm close
to a production release and would really rather not change Cheetah
versions right now.)  Alternatively, how difficult is it likely to be to
upgrade?

Any clue why Cheetah is so fast outside the .EXE without any
_namemapper.pyd around?
-- 
Aahz ([email protected])           <*>         http://www.pythoncraft.com/

"I won't accept a model of the universe in which free will, omniscient
gods, and atheism are simultaneously true."  --M

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf