[Zope] ZODB vs. Gadfly vs. ???
John Goerzen
jgoerzen@complete.org
09 Sep 1999 16:05:42 -0500
--Multipart_Thu_Sep__9_16:05:41_1999-1
Content-Type: text/plain; charset=US-ASCII
Hi,
First, thanks to everyone that has helped me along so far! It is
*tremendously* appreciated! You can see what I've managed to hack
together thus far at http://www.complete.org:8080/ACLUG/events
Now I need some advice rather than pointers on syntax (though I'm
still learning that, too). Here's my situation. I want to put up
information about some things (they happen to be single-time events,
but that's not terribly relevant). Kevin Dangoor and others suggested
that I make an Event ZClass, then give it an index_html or whatever to
fetch the events. Pretty slick, and it was easier to implement than a
gadfly thing, with which I had been failing due to not being aware of
_.DateTime().
However, I am running into some problems. I have only a couple dozen
Event objects in my eventsDb folder, but already there is a noticeable
performance hit. It takes the server about 3-4 seconds to render the
above page in calendar mode -- which is completely out of line no this
server, which is a cream-of-the-crop 600MHz Alpha. This is, no doubt, due to
inefficiency. To search for events on a given date, I have to iterate
through *all* the objects in there, inspecting dates. This must be
done for each day in a given month to determine whether there is an
event on that day (for displaying on a calendar square). Ick.
I'm using the Calendar product from the site, incidentally.
So:
* Am I missing out on some whiz-bang way to do searches through
a directory full of custom objects?
* Should I be using Gadfly instead? Would it be faster? Why is ZODB
so slow?
* In essence, because of the ZODB architecture or my own ignorance
of how to do it better, I'm getting performance of less than 10
queries per second. This is not acceptable.
Also, I am having performance worries. If the server chokes this fast
with only a couple dozen items, I am concerned. This server is
normally capable of dishing out many thousands of documents a second,
and even figuring worst-case here, (24 * 30), it's getting only 720
(and those aren't even complete documents, just lookups). Can someone
help ease my mind on this one?
Many thanks,
John Goerzen
--
John Goerzen Linux, Unix consulting & programming jgoerzen@complete.org |
Developer, Debian GNU/Linux (Free powerful OS upgrade) www.debian.org |
----------------------------------------------------------------------------+
The 49,581,309th prime number is 973,777,817.
--Multipart_Thu_Sep__9_16:05:41_1999-1
Content-Type: message/rfc822
Message-ID: <00a401bef649$8b7504a0$7b5addc7@laptop>
From: "Kevin Dangoor" <kid@kendermedia.com>
To: "John Goerzen" <jgoerzen@complete.org>
Subject: Re: [Zope] Many Zope questions
Date: Fri, 3 Sep 1999 16:18:53 -0400
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
-----Original Message-----
From: John Goerzen <jgoerzen@complete.org>
To: Kevin Dangoor <kid@kendermedia.com>
Cc: zope@zope.org <zope@zope.org>
Date: Friday, September 03, 1999 3:35 PM
Subject: Re: [Zope] Many Zope questions
>"Kevin Dangoor" <kid@kendermedia.com> writes:
>
>> Zope knows what types objects are. For example, if you do:
>> <dtml-var "someDateProperty + 5" fmt="%m/%d/%y">
>> you will get the date five days later than the date stored in the
property.
>>
>> Likewise, if you do:
>> <dtml-var "someDateProperty + 'foo'">
>> I believe you'll get an error. (not sure what adding a string to a date
>> would mean :)
>
>OK, I am confused. Where did you find these %m/%d/%y things? I am
>looking in Appendix A of the DTML guide and they aren't mentioned.
I think this is an undocumented feature...
>I am trying to do this:
>
><!--#var when fmt=DayOfWeek-->
>
>(substitute any other date thing for DayOfWeek)
>
>When I leave off fmt, the date is displayed, but it is ugly and with
>an unnecessary timezone, so I want to display it as I wish. when,
>BTW, comes from a gadfly database.
>
>When I try to view this, though, I get:
>
>Error Type: TypeError
>Error Value: not all arguments converted
>
>What am I doing wrong?
I've never used gadfly. Everything I've been doing with Zope has been within
the ZODB. And I've been a happy camper...
>> This is a fine question. I often look at the source code when I'm curious
>> about something and can't find docs on that specific topic. The Zope
source
>> is very readable.
>
>Ahh. Well, I don't know Python. C, Perl, C++, etc., yes, but no
>Python. I guess I ought to learn it, eh?
Take a look at the source, I think you'll be pleasantly surprised. If you
know C, Perl and C++, you'll probably be able to read the source just fine.
Probably the biggest thing you'll get by looking at parts of the source is a
completely accurate listing of exactly what methods an object has. This
doesn't really require knowing python. Just look for the "class" statements
and the "def" statements (which define methods).
Kevin
--Multipart_Thu_Sep__9_16:05:41_1999-1--