Re: Importing Cheetah.Template.Template unusually slow?

"R. Tyler Ballance" <[email protected]> Mon, 1 Feb 2010 19:53:34 -0800
Newsgroups gmane.comp.python.cheetah
Message-ID <[email protected]>
On Tue, 02 Feb 2010, Matthew Beauregard wrote:

> >Your workaround is fine, but you might want to look into why
> >you're not using
> >the compiled namemapper
> 
> Actually, yeah, that's just bit me.  There is (and has been for
> years) a difference between the C and Python NameMappers that my
> code triggers so parts of it only work with the C mapper.  That's
> been fine until now when I'm trying to build from git/next.

Ah yes indeed, this is another thing I've messed up in the next branch and
haven't had a chance to fix yet :)

I made a good chunk of changes without checking Hudson to see how they were
performing on other versions of Python and other platforms. This past weekend I
went back to Hudson and realized my error.

You can check out the current build results here:
    http://avocado.monkeypox.org:8080/job/Cheetah_next/

My apologies, I typically work under Python 2.6 so I was completely oblivious
to the breakages on Python 2.4 and 2.5

I'll probably fix it tonight or tomorrow sometime; I'll update the thread when
it's there

> 
> From what I can see the compiled mapper isn't building right for me:
> 
> gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
> -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall
> -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE
> -arch i386 -arch ppc -pipe -
> I/System/Library/Frameworks/Python.framework/Versions/2.5/include/
> python2.5 -c cheetah/c/_namemapper.c -o build/temp.macosx-10.5-
> i386-2.5/cheetah/c/_namemapper.o
> cheetah/c/_namemapper.c: In function ?setNotFoundException?:
> cheetah/c/_namemapper.c:38: warning: implicit declaration of
> function ?PyUnicode_FromFormat?
> cheetah/c/_namemapper.c:38: warning: assignment makes pointer from
> integer without a cast
> cheetah/c/_namemapper.c: In function ?setNotFoundException?:
> cheetah/c/_namemapper.c:38: warning: implicit declaration of
> function ?PyUnicode_FromFormat?
> cheetah/c/_namemapper.c:38: warning: assignment makes pointer from
> integer without a cast
> cheetah/c/_namemapper.c: In function ?wrapInternalNotFoundException?:
> cheetah/c/_namemapper.c:62: warning: assignment makes pointer from
> integer without a cast
> cheetah/c/_namemapper.c: In function ?wrapInternalNotFoundException?:
> cheetah/c/_namemapper.c:62: warning: assignment makes pointer from
> integer without a cast
> 
> So then I get:
> 
> >>> from Cheetah._namemapper import NotFound, valueForKey, valueForName
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: dlopen(/Library/Python/2.5/site-packages/Cheetah-2.4.2-
> py2.5-macosx-10.5-i386.egg/Cheetah/_namemapper.so, 2): Symbol not
> found: _PyUnicode_FromFormat
>   Referenced from: /Library/Python/2.5/site-packages/Cheetah-2.4.2-
> py2.5-macosx-10.5-i386.egg/Cheetah/_namemapper.so
>   Expected in: dynamic lookup
> 
> thanks,
> Matthew
> 
Cheers,
-R. Tyler Ballance
--------------------------------------
 Jabber: [email protected]
 GitHub: http://github.com/rtyler
Twitter: http://twitter.com/agentdero
   Blog: http://unethicalblogger.com

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com

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

iEYEARECAAYFAktnob0ACgkQFCbH3D9R4W8wdACdF8HTsaB5jT0Cl1wYPeMwFOHo
2u8An2SqZTZiA0gzwrTMX4ZXrKmBJrk8
=f/qJ
-----END PGP SIGNATURE-----