Message175022
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 |
|
Date |
User |
Action |
Args |
2012-11-06 22:46:27 | alexandre.vassalotti | set | recipients:
+ alexandre.vassalotti, pitrou, serhiy.storchaka |
2012-11-06 22:46:27 | alexandre.vassalotti | set | messageid: <1352241987.66.0.462819575283.issue12848@psf.upfronthosting.co.za> |
2012-11-06 22:46:27 | alexandre.vassalotti | link | issue12848 messages |
2012-11-06 22:46:26 | alexandre.vassalotti | create | |
|