Re: [ZODB-Dev] How to check for setting the same values on persistent objects?

2011-05-06 Thread Hanno Schlichting
On Fri, May 6, 2011 at 3:50 PM, Jim Fulton wrote: >> 1. Encourage everyone to do the old == new check in all application >> code before setting attributes on persistent objects. > > -1 at suggested, but it might be worth asking if there should be > changes to infrastructure that encourages lots of

Re: [ZODB-Dev] How to check for setting the same values on persistent objects?

2011-05-06 Thread Jim Fulton
On Wed, May 4, 2011 at 5:53 AM, Hanno Schlichting wrote: > Hi. > > I tried to analyze the overhead of changing content in Plone a bit. It > turns out we write back a lot of persistent objects to the database, > even tough the actual values of these objects haven't changed. > > Digging deeper I tri

Re: [ZODB-Dev] How to check for setting the same values on persistent objects?

2011-05-06 Thread Hanno Schlichting
On Thu, May 5, 2011 at 6:27 PM, Alexandre Garel wrote: >> I'm assuming doing a general check for "old == new" is not safe, as it >> might not be implemented correctly for all objects and doing the >> comparison might be expensive. > > I know very few of ZODB internals but in Python "old == new" do

Re: [ZODB-Dev] How to check for setting the same values on persistent objects?

2011-05-05 Thread Alexandre Garel
Le 04/05/2011 11:53, Hanno Schlichting a écrit : > Hi. > > I tried to analyze the overhead of changing content in Plone a bit. It > turns out we write back a lot of persistent objects to the database, > even tough the actual values of these objects haven't changed. > > Digging deeper I tried to und

Re: [ZODB-Dev] How to check for setting the same values on persistent objects?

2011-05-04 Thread Hanno Schlichting
On Wed, May 4, 2011 at 1:09 PM, Laurence Rowe wrote: > Persistent objects are also used as a cache and in that case code > relies on an object being invalidated to ensure its _v_ attributes are > cleared. Comparing at the pickle level would break these caches. So you would expect someone to store

Re: [ZODB-Dev] How to check for setting the same values on persistent objects?

2011-05-04 Thread Laurence Rowe
On 4 May 2011 10:53, Hanno Schlichting wrote: > Hi. > > I tried to analyze the overhead of changing content in Plone a bit. It > turns out we write back a lot of persistent objects to the database, > even tough the actual values of these objects haven't changed. > > Digging deeper I tried to under

Re: [ZODB-Dev] How to check for setting the same values on persistent objects?

2011-05-04 Thread Malthe Borch
On 4 May 2011 11:53, Hanno Schlichting wrote: > I tried to analyze the overhead of changing content in Plone a bit. It > turns out we write back a lot of persistent objects to the database, > even tough the actual values of these objects haven't changed. How about identifying the places in the ap

[ZODB-Dev] How to check for setting the same values on persistent objects?

2011-05-04 Thread Hanno Schlichting
Hi. I tried to analyze the overhead of changing content in Plone a bit. It turns out we write back a lot of persistent objects to the database, even tough the actual values of these objects haven't changed. Digging deeper I tried to understand what happens here: 1. persistent.__setattr__ will al