Files
cpython/Modules
Raymond Hettinger de68e0cf0e Speed-up deque indexing by changing the deque block length to a power of two.
The division and modulo calculation in deque_item() can be compiled
to fast bitwise operations when the BLOCKLEN is a power of two.

Timing before:

 ~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]'
10000000 loops, best of 7: 0.0627 usec per loop

Timing after:

~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]'
10000000 loops, best of 7: 0.0581 usec per loop
2013-07-05 18:05:29 -10:00
..
2013-06-19 09:01:58 -07:00
2013-05-08 10:56:32 +03:00
2012-06-22 21:12:59 +02:00
2013-06-25 00:44:31 +02:00
2012-10-25 10:47:46 +01:00
2013-02-13 12:32:32 +00:00
2012-09-29 13:47:39 -04:00
2012-12-14 20:13:39 +02:00
2012-09-29 13:47:39 -04:00
2013-01-01 07:41:51 -08:00
2013-06-20 21:30:32 -04:00