Message 305975 - Python tracker

Message305975

Author Olivier.Grisel
Recipients Olivier.Grisel, pitrou
Date 2017-11-09.18:11:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za>
In-reply-to
Content
I noticed that both pickle.Pickler (C version) and pickle._Pickler (Python version) make unnecessary memory copies when dumping large str, bytes and bytearray objects.

This is caused by unnecessary concatenation of the opcode and size header with the large bytes payload prior to calling self.write.

For protocol 4, an additional copy is caused by the framing mechanism.

I will submit a pull request to fix the issue for the Python version. I am not sure how to test this properly. The BigmemPickleTests seems to be skipped on my 16 GB laptop.
History
Date User Action Args
2017-11-09 18:11:50Olivier.Griselsetrecipients: + Olivier.Grisel, pitrou
2017-11-09 18:11:50Olivier.Griselsetmessageid: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za>
2017-11-09 18:11:50Olivier.Grisellinkissue31993 messages
2017-11-09 18:11:50Olivier.Griselcreate