Skip to content

Instantly share code, notes, and snippets.

@tseaver
Created February 24, 2014 01:06
Show Gist options
  • Save tseaver/9179994 to your computer and use it in GitHub Desktop.
Save tseaver/9179994 to your computer and use it in GitHub Desktop.
from ZODB import DB
from BTrees.IIBTree import IIBTree
import transaction
def populate_tree():
db = DB('fuckme.fs')
connection = db.open()
root = connection.root()
tree = root['tree'] = IIBTree()
for i in xrange(1000000):
tree[i] = 1
transaction.commit()
connection.cacheMinimize()
return tree
def main():
tree = populate_tree()
print('done')
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment