[Python-Dev] Python 3.4, marshal dumps slower (version 3 protocol)

Wolfgang tds333 at gmail.com
Mon Jan 27 18:23:20 CET 2014


Thanks Victor for improving this.

I also have to note, version 3 is only in the case of tuple in tuple
slower. If you use a flat tuple it is faster than version 2.
So I asked for this corner case and thought the recursion detection or
something else has a huge cost.

For pyc files, I think the highest available version is the used default.

I didn't know version 4, nowhere mentioned in the docs.

Also figured out, that every integer is accepted as protocol version. But
was usable for tests against 3.3 and 2.7. :-)



On Mon, Jan 27, 2014 at 5:02 PM, Brett Cannon <brett at python.org> wrote:

>
>
>
> On Mon, Jan 27, 2014 at 10:42 AM, Paul Moore <p.f.moore at gmail.com> wrote:
>
>> On 27 January 2014 15:35, Victor Stinner <victor.stinner at gmail.com>
>> wrote:
>> > Version 2 is the fastest in Python 3.3 and 3.4, but version 4 with
>> > Python 3.4 produces the smallest file.
>>
>> Which version is used when creating pyc files? This benchmark might
>> suggest that version 2 is the best...
>>
>
> Importlib just uses the default:
> http://hg.python.org/cpython/file/dbad4564cd12/Lib/importlib/_bootstrap.py#l671
>
>



-- 
bye by Wolfgang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140127/19344c52/attachment-0001.html>


More information about the Python-Dev mailing list