Memory allocation

Batista, Facundo FBatista at uniFON.com.ar
Tue Sep 23 08:56:07 EDT 2003


#- a pickle is just a serialized (i.e. flat) representation of the data
#- as a series of bytes, right?  In other words, a string?  So 
#- call len()
#- on it...  (as I said, that sounds too easy so I must be 
#- missing something).

The detail is that I *already have* the serialized object in disk, so:

	1. Load the pickled object from disk (already must)
	2. Unpickle the object to memory (already must)
	3. Keep the "backup" pickled object in memory
	4. ...
	5. Pickle the object (already must)
	6. Compare to the backup object
	7. If different, write to disk (already must)

So, the only overhead in the change of process is 

	1) keep the backup pickled object in memory: can do this if the
memory space overhead is not too big. 
	2) compare the serialized objects: if is to prevent a disk access,
makes the system faster.





More information about the Python-list mailing list