Performance problem with zpscopgda
I am having a performance problem on my site that from what I can tell (using CallProfiler) is related to a database query that returns about 600 rows. +0.2430 3.3720 74.8% | | | +- buildSelect +0.2474 0.0434 1.0% | | | | +- fetchSelectData +0.2534 0.0016 0.0% | | | | | +- buildSelectQuery 0.0375 0.8% | | | | | | 3.3676 74.7% | | | | | It is a very simple query, it only fetches two columns from a single table. Is it normal for this to take over three seconds (less than one second from php+pear)? I have enabled caching up to 650 records for 30 seconds, but this doesn't seem to make any difference. Does anyone have any suggestions for how I can improve this? Thanks, Mark Roach
Roach, Mark R. wrote at 2003-3-17 13:28 -0500:
I am having a performance problem on my site that from what I can tell (using CallProfiler) is related to a database query that returns about 600 rows.
+0.2430 3.3720 74.8% | | | +- buildSelect +0.2474 0.0434 1.0% | | | | +- fetchSelectData +0.2534 0.0016 0.0% | | | | | +- buildSelectQuery 0.0375 0.8% | | | | | | 3.3676 74.7% | | | | |
It is a very simple query, it only fetches two columns from a single table. Is it normal for this to take over three seconds (less than one second from php+pear)? I have enabled caching up to 650 records for 30 seconds, but this doesn't seem to make any difference.
Does anyone have any suggestions for how I can improve this?
I expect that the rendering is quite costly. DTML and Python scripts perform a costly security check (it the user allowed to access this variable/method) on every access. Try to implement the rendering in an External Method and see whether it becomes faster. I can recommend my "ZopeProfiler" product to see precisely where Zope spends its time. See <http://www.dieter.handshake.de/pyprojects/zope> Dieter
On Tue, 2003-03-18 at 16:34, Dieter Maurer wrote:
I expect that the rendering is quite costly.
DTML and Python scripts perform a costly security check (it the user allowed to access this variable/method) on every access.
Hi, Dieter, I think you are right, it does appear to be the rendering and not the sql query (good news). I guess I was reading that output incorrectly. I have discovered that using a python script instead of dtml, even for what seems like very simple markup can make a tremendous performance difference. I replaced a couple of often-run dtml methods with python scripts and reduced execution time from 5+ seconds to ~.8 seconds in some cases. I was pretty surprised by how drastic that was.
Try to implement the rendering in an External Method and see whether it becomes faster.
I can recommend my "ZopeProfiler" product to see precisely where Zope spends its time. See
Thanks, I will try both of those suggestions. I guess it might also be time for me to investigate writing a product. Thanks again for your help. -Mark
participants (2)
-
Dieter Maurer -
Roach, Mark R.