Antoine Pitrou added the comment:

> Memoization consumes memory during pickling. For now every memoized
> object requires memory for:
> 
> dict's entity;
> an id() integer object;
> a 2-element tuple;
> a pickle's index (an integer object).
> 
> It's about 80 bytes on 32-bit platform (and twice as this on 64-bit).

As far as I understand, Alexandre doesn't propose to suppress
memoization, only to make it implicit. Therefore the memory overhead
would be the same (but the pickle would have less opcodes).

> For data which contains a lot of floats it can be cumbersome.

Apparently, floats don't get memoized:

>>> pickletools.dis(pickle.dumps([1.0, 2.0]))
    0: \x80 PROTO      3
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: (    MARK
    6: G        BINFLOAT   1.0
   15: G        BINFLOAT   2.0
   24: e        APPENDS    (MARK at 5)
   25: .    STOP

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17810>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to