Skip to content

Instantly share code, notes, and snippets.

@smarnach
Created January 17, 2012 23:06
Show Gist options
  • Save smarnach/1629659 to your computer and use it in GitHub Desktop.
Save smarnach/1629659 to your computer and use it in GitHub Desktop.
>>> timeit.repeat("a = deque()\nfor i in xrange(10000): a.append(i)\nfor x in a: x",
... "from collections import deque", number=1000)
[1.4415068626403809, 1.4344120025634766, 1.4339849948883057]
>>> timeit.repeat("a = []\nfor i in xrange(10000): a.append(i)\nfor x in a: x", number=1000)
[1.3635458946228027, 1.3510761260986328, 1.3518819808959961]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment