Skip to content

Instantly share code, notes, and snippets.

@smarnach
Created January 17, 2012 17:02
Show Gist options
  • Save smarnach/1627501 to your computer and use it in GitHub Desktop.
Save smarnach/1627501 to your computer and use it in GitHub Desktop.
>>> timeit.repeat("for i in xrange(1000): a.append(i)",
... "from collections import deque; a = deque()", number=10000)
[1.139456033706665, 1.1287789344787598, 1.129647970199585]
>>> timeit.repeat("for i in xrange(1000): a.append(i)", "a = []", number=10000)
[1.1056618690490723, 1.0919761657714844, 1.0903148651123047]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment