Message174679
If you look at the implementation of deque.rotate(), it does the equivalent of deque.append(deque.popleft()) or deque.appendleft(deque.pop()).
Unfortunately, for larger rotations, the pop() and append() calls just do too much work. Since the documentation recommends using rotate() to do slicing-style operations, this could get seriously slow.
deque.rotate() could just touch up the internal pointers and use memmove() to realign the data.
Benchmarks, of course, would have to be written to make sure this is a win. |
|
Date |
User |
Action |
Args |
2012-11-03 19:31:06 | sfllaw | set | recipients:
+ sfllaw |
2012-11-03 19:31:06 | sfllaw | set | messageid: <1351971066.78.0.209275581981.issue16398@psf.upfronthosting.co.za> |
2012-11-03 19:31:06 | sfllaw | link | issue16398 messages |
2012-11-03 19:31:06 | sfllaw | create | |
|