Skip to content

Instantly share code, notes, and snippets.

@dw
Created April 29, 2014 16:20
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 dw/11405132 to your computer and use it in GitHub Desktop.
Save dw/11405132 to your computer and use it in GitHub Desktop.
#
# with 2047 of 2048 reader slots allocated
#
$ python -mtimeit -s 'import lmdb; e = lmdb.open("/tmp/test")' 'e.begin().abort()'
100000 loops, best of 3: 10.1 usec per loop
$ git stash &>/dev/null ; python setup.py build &> /dev/null
$ python -mtimeit -s 'import lmdb; e = lmdb.open("/tmp/test")' 'e.begin().abort()'
1000000 loops, best of 3: 0.47 usec per loop
#
# with 0 of 2048 reader slots allocated
#
$ python -mtimeit -s 'import lmdb; e = lmdb.open("/tmp/test")' 'e.begin().abort()'
1000000 loops, best of 3: 1.91 usec per loop
$ git stash pop &>/dev/null ; python setup.py build &> /dev/null
$ python -mtimeit -s 'import lmdb; e = lmdb.open("/tmp/test")' 'e.begin().abort()'
1000000 loops, best of 3: 0.472 usec per loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment