Vinay Sajip <vinay_sa...@yahoo.co.uk> added the comment:

@Amaury: Re formatting and comment style - I will address this. The diff I 
posted is to the default branch rather than 3.2, though it won't change the 
main substance of the patch.

Re. performance and buffering: I agree this could have an impact (although 
strings are not actually read a byte at a time), but it's not easy to address 
because even if you e.g. wrapped the incoming stream with a BufferedReader, you 
have nowhere to keep the resulting instance in between multiple calls to 
marshal.load() from external code.

For best performance ISTM you'd have to implement your own buffering - but 
surely this is to be avoided? It can't be the only place where you need good 
I/O performance from file-like objects. A quick scan of the pickle module 
didn't show me anything I could easily use, and a key difference from pickle is 
that you don't have a corresponding "Unmarshaller" object which could hold the 
state that an Unpickler does, and which would be needed to hold the buffering 
state.

Of course one could implement limited buffering, i.e. for just the duration of 
a single marshal.load() call, but perhaps this could be done as a later step 
after evaluating the actual performance of this implementation. Having 
something that works correctly, albeit slowly, is better than having the 
current situation ...

----------

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

Reply via email to