Loading ...
Sorry, an error occurred while loading the content.

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

Expand Messages
  • Aahz
    Oct 13, 2009
    • 0 Attachment
      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.)
      --
      Aahz (aahz@...) <*> http://www.pythoncraft.com/

      "To me vi is Zen. To use vi is to practice zen. Every command is a
      koan. Profound to the user, unintelligible to the uninitiated. You
      discover truth everytime you use it." --reddy@...

      ------------------------------------------------------------------------------
      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
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • Show all 4 messages in this topic