how much does changing a property add to data.fs??
Good morning friends, I was just wondering how changing attributes of an object does change the data.fs size. Is it only the changed attribute that is added to the end of data.fs or is the whole object copied??? I would assume the first. Is that so? Robert
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Robert Rottermann
I was just wondering how changing attributes of an object does change the data.fs size. Is it only the changed attribute that is added to the end of data.fs or is the whole object copied???
I would assume the first. Is that so?
Based on my testing during developing the caching stuff for Photo, it appears that any change to the object adds a complete new copy of the object. When I just set _p_changed = 1, without even changing a property, Data.fs increased by the size of the image plus a bit. Of course, the ZC guys and probably others can verify this for sure. _______________________ Ron Bickers Logic Etc, Inc.
It depends on the property size and the type of object. This is easy to test. Look at the size of your Data.fs, add a property, look at it again. ;-) - C ----- Original Message ----- From: "Robert Rottermann" <robert@redcor.ch> To: <zope@zope.org> Sent: Friday, November 09, 2001 1:31 AM Subject: [Zope] how much does changing a property add to data.fs??
Good morning friends,
I was just wondering how changing attributes of an object does change the data.fs size. Is it only the changed attribute that is added to the end of data.fs or is the whole object copied???
I would assume the first. Is that so? Robert
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
As you said, it probably depends. So what is the best condition to get a good look at data.fs? And do I have to stop Zope to have everything flushed. Nevertheless a brilliant idea. By the way, the reason I asked was what code is better: for prop in obj: change property or for prop in obj: collect property in dic ibj.changeproperties(dic) Robert :-) ----- Original Message ----- From: "Chris McDonough" <chrism@zope.com> To: "Robert Rottermann" <robert@redcor.ch>; <zope@zope.org> Sent: Friday, November 09, 2001 8:06 AM Subject: Re: [Zope] how much does changing a property add to data.fs??
It depends on the property size and the type of object.
This is easy to test. Look at the size of your Data.fs, add a property, look at it again. ;-)
- C
----- Original Message ----- From: "Robert Rottermann" <robert@redcor.ch> To: <zope@zope.org> Sent: Friday, November 09, 2001 1:31 AM Subject: [Zope] how much does changing a property add to data.fs??
Good morning friends,
I was just wondering how changing attributes of an object does change the data.fs size. Is it only the changed attribute that is added to the end of data.fs or is the whole object copied???
I would assume the first. Is that so? Robert
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Robert Rottermann wrote:
By the way, the reason I asked was what code is better: for prop in obj: change property or for prop in obj: collect property in dic ibj.changeproperties(dic)
From a persistence point of view, they're both the same...
Chris
Robert Rottermann wrote:
Is it only the changed attribute that is added to the end of data.fs or is the whole object copied???
Not as simple as that... it depends whether the attribute type subclasses Persistent or not. eg: Take an object, x, whose class subclasses Persistent x.a=1 x.b=PersistentMapping() Now, doing: x.a +=1 ...would cause a whole copy of x to be appended to the Data.fs doing: x.b['fish']='halibut' ...would cause only a new copy of b to be added to the Data.fs Unfortunately, because of the way they're implemented, properties behave like a :-( cheers, Chris
participants (4)
-
Chris McDonough -
Chris Withers -
Robert Rottermann -
Ron Bickers