On 13 August 2013 15:40, Joerg Baach <li...@baach.de> wrote:
> So, can it really be that using a PersistentList is 300 times slower? Am
> I doing something completely wrong, or am I missing something?

In your test setup, you commit the transaction and close the
connection. This means that when you iterate through the edges, not
only do you load buckets, but for each item in the bucket, you load an
additional persistent object, namely the `PersistentList`.

This doesn't happen when you persist a Python list. In that case, the
list is simply persisted right into the bucket data. This makes the
buckets take up more space, but you need less reads from disk which
makes the whole thing go a lot faster.

Note that once you've loaded all the `PersistentList` objects,
iterating again should go much faster because it's now all in memory.

For more information about ZODB, see http://zodb.org/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org

Reply via email to