[Zope-CMF] [Inefficiency] "FSDirectoryView.manage_workspace" requires excessive time

Dieter Maurer dieter@handshake.de
Tue, 14 Jan 2003 19:05:14 +0100


Often, I have been annoyed by the incredibly high amount of time
used by "FSDirectoryView.manage_workspace".

Today, I use the profiler to find out where this time is spend:

       total time:			    22 s
       time in ZopePageTemplate.get_size:   14 s

The reason: "ZopePageTemplate.get_size" parses the page template
(which is know to be expensive) before it determines the size.

I made a small in "CMFCore.FSPageTemplate":

    # DM: leads to parsing
    #get_size = ZopePageTemplate.get_size
    #getSize = get_size
    getSize = FSObject.get_size

This change reduced the time from 22s to 8s.

>From these 8s, 6s are spend in PythonScript parsing.
This is a bit more difficult to mend, because the parsing
is done in order to determine the scripts "title".
But here, too, we can drastically reduce the time,
when we are ready to work a bit.


My change above may not work in a stock CMF because I use
a patched PageTemplate product to delays parsing as long
as possible.


Dieter