Author alexandre.vassalotti
Recipients alexandre.vassalotti, pitrou, serhiy.storchaka
Date 2012-11-06.22:46:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1352241987.66.0.462819575283.issue12848@psf.upfronthosting.co.za>
In-reply-to
Content
pickle.py is the buggy one here. Its use of the marshal module is really a hack. Plus, it is slower than both struct and int.from_bytes.

14:40:57 [~/cpython]$ ./python -m timeit "int.from_bytes(b'\xff\xff\xff\xff', 'big')"
1000000 loops, best of 3: 0.209 usec per loop
14:38:03 [~/cpython]$ ./python -m timeit -s "import struct" "struct.unpack('>I', b'\xff\xff\xff\xff')"
10000000 loops, best of 3: 0.147 usec per loop
14:37:44 [~/cpython]$ ./python -m timeit -s "import marshal" "marshal.loads(b'i'+b'\xff\xff\xff\xff')"
1000000 loops, best of 3: 0.236 usec per loop
History
Date User Action Args
2012-11-06 22:46:27alexandre.vassalottisetrecipients: + alexandre.vassalotti, pitrou, serhiy.storchaka
2012-11-06 22:46:27alexandre.vassalottisetmessageid: <1352241987.66.0.462819575283.issue12848@psf.upfronthosting.co.za>
2012-11-06 22:46:27alexandre.vassalottilinkissue12848 messages
2012-11-06 22:46:26alexandre.vassalotticreate