Question: is deque faster than list?
Answer: Deques have O(1) speed for appendleft() and popleft() while lists have O(n) performance for insert(0, value) and pop(0). List append performance is hit and miss because it uses realloc() under the hood. ... In contrast, deque append performance is consistent because it never reallocs and never moves data.