[issue5483] [PATCH]Add FastDbfilenameShelf: shelf nerver sync cache even when writeback=True

Zhigang Wang report at bugs.python.org
Fri Mar 13 14:12:05 CET 2009


New submission from Zhigang Wang <w1z2g3 at gmail.com>:

shelf without writeback=True is too slow, while shelves with
writeback=True takes too much time to close. And even worse, these codes
can not run:

$ cat test_shelve.py
#!/usr/bin/env python

import shelve

store = shelve.open("/tmp/shelve.db", writeback=True)

class Test(object):
    pass

def main():
    store["a"] = Test()

if __name__ == '__main__':
    main()

$ python test_shelve.py 
Exception cPickle.PicklingError: "Can't pickle <class '__main__.Test'>:
it's not the same object as __main__.Test" in  ignored

With this module, we can make it to run.

I think it's worth add this function to shelve. We can achieve great
improvement with some avoidable limitations.

The other approach to add this function is to add a extra option the
shelve.open(). We can discuss for which is better.

----------
components: Library (Lib)
files: fast_shelf.patch
keywords: patch
messages: 83516
nosy: zhigang
severity: normal
status: open
title: [PATCH]Add FastDbfilenameShelf: shelf nerver sync cache even when writeback=True
type: feature request
versions: Python 3.1
Added file: http://bugs.python.org/file13317/fast_shelf.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5483>
_______________________________________


More information about the Python-bugs-list mailing list