boxing

Why are Python's arrays slow?

Why are Python's arrays slow? Question: I expected array.array to be faster than lists, as arrays seem to be unboxed. However, I get the following result: In [1]: import array In [2]: L = list(range(100000000)) In [3]: A = array.array(‘l’, range(100000000)) In [4]: %timeit sum(L) 1 loop, best of 3: 667 ms per loop In …

Total answers: 5