from timeit import timeit
timeit('s.appendleft(37)', 'import collections; s = collections.deque()',
    number=1000000)
timeit('s.insert(0,37)', 's = []', number=1000000)
Efficiency of using a Python list as a queue