[Zope] Problem: performance of retrieving properties from objects...

Lennart Regebro lennart@torped.se
Sat, 6 Apr 2002 10:48:19 +0200


From: "Antwan Reijnen" <twanus@xs4all.nl>

> 1) Suppose I build a new python baseclass in which the bulk of my
> properties are stored. My slow ZClass object (actually a CMF object)
> uses this as a base class, and I write my own data-retrieval methods.
> How much will the increase in performance be?

The depends entirely on what the data retrival methods are...

> 2) Suppose I have to switch to a database (there goes my weekend and free
> evenings next week). I want to retrieve the properties as one record then.
I
> think the number of 400 props will decrease in this matter, too.

Why would they decrease just because you move them to a relational database?

> I assume the database will retrieve these results a LOT faster.

That depends on the database... And it depends on why it is so slow. I think
the fact that you have so many properties add to the slowness, since each of
then has to be looked up. So a database would be faster here, since they
have a fixed data structure. On the other hand, you might get the same
effect by radically altering your data structure. Which brings us to the
main question:

***Why on earth do you have 400 properties?***

> How about using this database in combination with an existing catalog?

It can be done, but is not necessary. Index the data in the database
instead.

> 3) Suppose I build a CMF product entirely in python (may god help me), and
> I store all these properties as mentioned in (1), would the performance be
> higher than in case (1)?

Python classes are supposedly faster than ZClasses (I don't use ZClasses, as
I find them complicated, limited and cumbersome), so yes it would probably
be faster, but I can't say how much