Skip to content

Instantly share code, notes, and snippets.

@clayg
Created January 16, 2017 21:02
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 clayg/c6a5c41b12c7f0c4075386d3f23d6d81 to your computer and use it in GitHub Desktop.
Save clayg/c6a5c41b12c7f0c4075386d3f23d6d81 to your computer and use it in GitHub Desktop.
slower than I thought
clayg:~/Workspace/SwiftStack$ python -m timeit -s 'import pickle; data = pickle.dumps({"%0.3x" % x: None for x in range(0xfff)})' 'pickle.loads(data)'
100 loops, best of 3: 18.4 msec per loop
clayg:~/Workspace/SwiftStack$ python -m timeit -s 'import cPickle as pickle; data = pickle.dumps({"%0.3x" % x: None for x in range(0xfff)})' 'pickle.loads(data)'
1000 loops, best of 3: 1.5 msec per loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment