Skip to content

Instantly share code, notes, and snippets.

@hongruiqi
Created August 18, 2012 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hongruiqi/3386670 to your computer and use it in GitHub Desktop.
Save hongruiqi/3386670 to your computer and use it in GitHub Desktop.
py dict
import time
def test():
key = list(map(str, range(10000000)))
t = time.time()
d=dict()
for i in xrange(10000000):
d[key[i]] = i
for i in xrange(10000000):
del d[key[i]]
print "python2: ", time.time() - t
test()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment