How slow should dtml-var be? (was: RE: [Zope] Problems with *BIG* SQL queries)

Jens Vagelpohl jens@digicool.com
Wed, 21 Mar 2001 14:47:57 -0500


here's something that will probably help: push it into an external method.

mymethod.py (untested):

import string

def mymethod(self):
    log = []
    log.append(self.ZopeTime())

    for r in self.QUERY():
        log.append(%s,%s,%s,%s" % (r.column1,r.column2,r.column3,r.column4))

    log.append(self.ZopeTime())

    return string.join(log, '\n')

...and run it from the "test" tab after instantiating the external method
object. the time *should* improve considerably.

jens


> 
> Using a PythonScript:
> 
> print context.ZopeTime()
> for result in container.QUERY():
>   print "%s,%s,%s,%s" % (r.column1,r.column2,r.column3,r.column4)
> print context.ZopeTime()
> return printed
> 
> ...doesn't seem to help