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

Shane Hathaway hathawsh@pi.slcc.edu
Wed, 29 Mar 2000 19:55:51 -0700 (MST)


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!
;-)

Shane