I was always intrigued by Python's collections.deque
object. It seems to be like a list, except that adding/deleting items in the beginning is faster than in a list.
This makes me want to replace list
with deque
in various places in my code where I have a list that I do left pops on. So my question: Did anyone ever benchmark deque
against list
in such scenarios?