LevelDB uses a background thread for compaction, and with custom comparators this background thread calls back into Python code, which means the GIL must be initialized. Fixes #35.
The "live iterators" dict on DB instances keeps weakrefs, but while the iterators pointed to by these weakrefs were released, the weakrefs themselves were not. In older revisions, this cleanup was done by WeakValueDictionary.
Much of the time required to constructan iterator is spent in the WeakValueDictionary class, which is written in Python. Handle the weakrefs manually from C code avoids that overhead, which results in a major performance gain.
...instead of implicit type conversions and the None defaults for these flags. While at it, clean up the Python bool version C++ bool mess.
By not using kwargs for internal API calls, the dict overhead incurred by each call can be avoided. This results in a significant performance gain in microbenchmarks measuring iterator and write batch construction time.
Added a .raw_iterator() method to DB and Snapshot instances. The RawIterator instance returned by .raw_iterator() mimics the C++ iterator API provided by LevelDB. The API is almost a direct mapping, except for some added error handling, which is required to avoid segfaults or other aborts from within LevelDB. See issue #17.
See issue #17.