Re: Slow templates in py2exe

"R. Tyler Ballance" <[email protected]> Fri, 18 Sep 2009 10:33:29 -0700
Newsgroups gmane.comp.python.cheetah
Message-ID <[email protected]>
On Thu, 17 Sep 2009, Aahz wrote:
> > 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
> ?

Perhaps if you asked James nicely enough he could post a build of 2.0.1
on Windows, the downside of this of course is that prior to v2.2.2
Cheetah was less-than-friendly in terms of building on Windows (which is
why we actually had _namemapper.pyd files checked in.)


> 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?

The upgrade isn't too terribly difficult provided you're not already
handling unicode objects in some hackish fashion (we had this issue at
Slide, some "automagic code" encoding/decoding back and forth into utf-8
encoded str objects). 

Might be worth a try depending on your timeline.

> Any clue why Cheetah is so fast outside the .EXE without any
> _namemapper.pyd around?

The very nature of the NameMapper's function means it's going to call a
lot of functions and iterate quite a bit through a few lists, IIRC the
C version just cuts down a lot of overhead related to Python dynamic
lookup and dispatch. I'm probably wrong about that though :)


Cheers

-R. Tyler Ballance
Slide, Inc.

p.s. mind me asking what you're shipping with Cheetah on Windows? :D

------------------------------------------------------------------------------
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

_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAkqzxGkACgkQFCbH3D9R4W8cnACgia2/hkDnv6v+XTDFGTO+nfQl
zngAniBjmRB4PTt3OmfCkoOoLwTYieHm
=fOyB
-----END PGP SIGNATURE-----