[Zope-dev] [Patch] Optimization for development mode

Patrick Phalen zope@teleo.net
Wed, 29 Mar 2000 22:59:20 -0800


Good eye, Shane! It does feel more responsive now.

[Shane Hathaway, on Wed, 29 Mar 2000]
:: Ever since I started using Zope I thought its management
:: interface was a little sluggish.  Today I found out why, and
:: the correction is very easy.  If you are running Zope in
:: development mode, especially in Unix, you will notice a
:: healthy improvement in responsiveness.
:: 
:: It turns out that because of a small bug, every time a DTML
:: file is read from the file system (including management
:: pages) it is re-parsed whether the file was modified or not.
:: The reason is because the current logic checks not only the
:: file modification date but also the file access date, which
:: changes every time the file is read.
:: 
:: Open lib/python/App/special_dtml.py in a text editor.
:: Change one line (probably line 115) from:
:: 
::          t=os.stat(self.raw)
:: 
:: to:
:: 
::          t=os.path.getmtime(self.raw)
:: 
:: Restart Zope and enjoy a slightly faster development cycle!