[ZODB-Dev] Re: ZODB Benchmarks

Marius Gedminas mgedmin at b4net.lt
Tue Nov 6 15:43:08 EST 2007


On Tue, Nov 06, 2007 at 10:01:24PM +0200, Roché Compaan wrote:
> On Tue, 2007-11-06 at 17:40 -0200, Sidnei da Silva wrote:
> > > Despite this change there are still a huge amount
> > > of unexplained calls to the 'persistent_id' method of the ObjectWriter
> > > in serialize.py.
> > 
> > Why 'unexplained'? 'persistent_id' is called from the Pickler instance
> > being used in ObjectWriter._dump(). It is called for each and every
> > single object reachable from the main object, due to the way Pickler
> > works (I believe). Maybe persistent_id can be analysed and optimized
> > for the most common cases?
> > 
> 
> If you look at the profiler stats I posted earlier you would have
> noticed that there was about 1.3 million calls to persistent_id while
> only 20000 objects were persisted. So if it is being called for each
> object I would expect a figure closer to 20000, not 1.3 million. What am
> I missing?

AFAIU persisted_id() is called once for every reference to a persisten
object rather than once for every persistent object.  If there were 65
references to each of the 20000 objects you'd get 1.3 million calls to
persistent_id().

Marius Gedminas
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zodb-dev/attachments/20071106/514d1fa1/attachment.bin


More information about the ZODB-Dev mailing list