Quick checkin to make sure I still have the mechanics straight in this
directory.
This commit is contained in:
parent
9b88421c6a
commit
21a586e1b3
|
@ -36,9 +36,7 @@ Introduction
|
|||
Motivation
|
||||
|
||||
Pickling new-style objects causes serious pickle bloat. For
|
||||
example, the binary pickle for a classic object with one instance
|
||||
variable takes up 33 bytes; a new-style object with one instance
|
||||
variable takes up 86 bytes. This was measured as follows:
|
||||
example,
|
||||
|
||||
class C(object): # Omit "(object)" for classic class
|
||||
pass
|
||||
|
@ -46,6 +44,9 @@ Motivation
|
|||
x.foo = 42
|
||||
print len(pickle.dumps(x, 1))
|
||||
|
||||
The binary pickle for the classic object consumed 33 bytes, and for
|
||||
the new-style object 86 bytes.
|
||||
|
||||
The reasons for the bloat are complex, but are mostly caused by
|
||||
the fact that new-style objects use __reduce__ in order to be
|
||||
picklable at all. After ample consideration we've concluded that
|
||||
|
|
Loading…
Reference in New Issue