Re: [Zope] Strange problem about Catalog
Dear Dieter, Actually I don't understand how "monkey patching" works, and i could not find a description in zope.org. I just put the folder 'ZopeProfiler' into the directory lib/python/products, then restart the zserver. ZopeProfiler did appear in ControlPanel, but the tabs are 'contents', 'properties','define permissions','undo', 'find', 'Readme', and 'Refresh'. And under contents, only help(ZopeProfiler). The version of Zope I used is 2.7. I also tried 2.6, the same result. could you tell me what is wrong? Thanks --- Dieter Maurer <dieter@handshake.de> wrote:
Star War wrote at 2004-2-23 12:38 -0800:
But I have trouble to use ZopeProfiler. Actually I don't know how to use it. After installation, I could not find "Documentation" tab for ZopeProfiler object. There is a README tab. Is something wrong in my installation?
The README tells you:
ZopeProfiler installs itself through "monkey patching". You will then find a ZopeProfiler in your "Control_Panel". Please read the "Documentation" tab for further information.
The ZopeProfiler instance in the control panel used to have a "Documentation" tab. The underlaying method ("showDocumentation") has been renamed to "showInfo" (in order not to clash with "DocFinderEveryWhere") and the tab has been renamed to "Info".
I will correct the README file for the next release.
-- Dieter
__________________________________ Do you Yahoo!? Get better spam protection with Yahoo! Mail. http://antispam.yahoo.com/tools
Star War wrote at 2004-2-26 09:22 -0800:
Actually I don't understand how "monkey patching" works, and i could not find a description in zope.org. I just put the folder 'ZopeProfiler' into the directory lib/python/products, then restart the zserver. ZopeProfiler did appear in ControlPanel, but the tabs are 'contents', 'properties','define permissions','undo', 'find', 'Readme', and 'Refresh'. And under contents, only help(ZopeProfiler). The version of Zope I used is 2.7. I also tried 2.6, the same result.
You look at the wrong place. Apparently, you are looking at the "ZopeProfiler" product (!) entry in "Control_Panel --> Product Management". You should look at the "ZopeProfiler" instance (!) in "Control_Panel" itself -- at its very bottom. If there is not "ZopeProfiler" instance there, something went wrong with the installation. Activate Zope logging in this case and look into the logfile. -- Dieter
Sorry. I made a mistake. When I said in 'Control Panel', I acutally mean 'ControlPanel/Products', I just found the ZopeProfiler in ControlPanel. It is just below Debug Information in my zope server. BTW, I figured out what caused my pages very slow. The orignial designer put <dtml-in Catalog size=1 sort=... reverse> to get Last-Modified Date. After I recataloged, about 1,700 items in catalog, this statements takes about 6 seconds in the server. I have changed it into <dtml-in "Catalog(..., sort_on=..., sort_order=...)" size=1>, it just takes 2 seconds. I'm not sure if it is normal. Does somebody has a better way to get the lastest date? Thanks Dieter. --- Star War <starwar992001@yahoo.com> wrote:
Dear Dieter,
Actually I don't understand how "monkey patching" works, and i could not find a description in zope.org. I just put the folder 'ZopeProfiler' into the directory lib/python/products, then restart the zserver. ZopeProfiler did appear in ControlPanel, but the tabs are 'contents', 'properties','define permissions','undo', 'find', 'Readme', and 'Refresh'. And under contents, only help(ZopeProfiler). The version of Zope I used is 2.7. I also tried 2.6, the same result.
could you tell me what is wrong?
Thanks
--- Dieter Maurer <dieter@handshake.de> wrote:
Star War wrote at 2004-2-23 12:38 -0800:
But I have trouble to use ZopeProfiler. Actually I don't know how to use it. After installation, I could not find "Documentation" tab for ZopeProfiler object. There is a README tab. Is something wrong in my installation?
The README tells you:
ZopeProfiler installs itself through "monkey patching". You will then find a ZopeProfiler in your "Control_Panel". Please read the "Documentation" tab for further information.
The ZopeProfiler instance in the control panel used to have a "Documentation" tab. The underlaying method ("showDocumentation") has been renamed to "showInfo" (in order not to clash with "DocFinderEveryWhere") and the tab has been renamed to "Info".
I will correct the README file for the next release.
-- Dieter
__________________________________ Do you Yahoo!? Get better spam protection with Yahoo! Mail. http://antispam.yahoo.com/tools
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
__________________________________ Do you Yahoo!? Get better spam protection with Yahoo! Mail. http://antispam.yahoo.com/tools
Star War wrote:
I have changed it into <dtml-in "Catalog(..., sort_on=..., sort_order=...)" size=1>, it just takes 2 seconds. I'm not sure if it is normal. Does somebody has a better way to get the lastest date?
There is really no need to sort the query. You just need to find the largest date. So how about something like: last_changed = max([ b.bobobase_modification_time for b in context.Catalog(...,) ]) regards Max M
Star War wrote at 2004-2-26 15:30 -0800:
... BTW, I figured out what caused my pages very slow. The orignial designer put <dtml-in Catalog size=1 sort=... reverse> to get Last-Modified Date. After I recataloged, about 1,700 items in catalog, this statements takes about 6 seconds in the server. I have changed it into <dtml-in "Catalog(..., sort_on=..., sort_order=...)" size=1>, it just takes 2 seconds. I'm not sure if it is normal. Does somebody has a better way to get the lastest date?
Casey recently implemented a "limit" option for "searchResults". It can drastically bring down sorting time (from "O(n log(n))" to "O(n)"). Using "limit=1" is essentially equivalent to the loop proposed in a different message. -- Dieter
Dieter Maurer wrote:
Casey recently implemented a "limit" option for "searchResults". It can drastically bring down sorting time (from "O(n log(n))" to "O(n)"). Using "limit=1" is essentially equivalent to the loop proposed in a different message.
What Zope releases is this in? cheers, Chris
Chris Withers wrote at 2004-3-1 20:00 +0000:
Casey recently implemented a "limit" option for "searchResults". It can drastically bring down sorting time (from "O(n log(n))" to "O(n)"). Using "limit=1" is essentially equivalent to the loop proposed in a different message.
What Zope releases is this in?
Lazy Chris :-( I see it in Zope 2.7b3. More detailed info via Zope's "http://cvs.zope.org"... -- Dieter
Dieter Maurer wrote:
Lazy Chris :-(
yep ;-)
I see it in Zope 2.7b3.
More detailed info via Zope's "http://cvs.zope.org"...
Great, hopefully it made 2.7.0 then :-) I remember seeing some code for this, but it didn't appear to be wired up to anything, that said, sounds like you've tried it, so I'll see about upgrading and seeing how much of a difference it makes... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (4)
-
Chris Withers -
Dieter Maurer -
Max M -
Star War