Re: [PATCH] Remove unnecessary dir()/set() calls in Template.__init__()

[email protected] Tue, 13 Oct 2009 10:22:56 -0700
Newsgroups gmane.comp.python.cheetah
Message-ID <20091013172256.GF9649@banana>
On Tue, 13 Oct 2009, Aahz wrote:

> On Mon, Oct 12, 2009, R. Tyler Ballance wrote:
> >
> > When running cheetah.Tests.Performance.DynamicMethodCompilationTest
> > with 100000 iterations set, Template.__init__() is the most performance
> > sensitive call.
> 
> This seems like a safe change.  I would even go a step further in
> performance and reducing namespace pollution:
> 
> Template.Reserved_SearchList = set(dir(Template))
> 
> You can then go back to using self.Reserved_SearchList, which should be
> faster than a global lookup.  (I'm only mentioning this because you're
> using the lookup in a loop.)

Good point; thanks for the suggestion. Updated in rtyler/next
(http://github.com/rtyler/cheetah/tree/next)


Cheers,
-R. Tyler Ballance

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) 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 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

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

iEYEARECAAYFAkrUt3AACgkQFCbH3D9R4W8m2gCeP38ZZeIbhzKHvAUW2N+P/ohx
fiMAoJNWMcYgA5ZUJdvw6U2YsZKvZV/m
=8E/v
-----END PGP SIGNATURE-----