Created originally on Bitbucket by vvladymyrov (Volodymyr Vladymyrov)
Was already merged in Bitbucket before import, marked as merged by the import user
improve contains and getitem performance almost 2x times using trick I've seen in py-lmdb to avoid key alloc/dup: see https://github.com/dw/py-lmdb/blob/master/lmdb/cffi.py#L228-L230
My benchmark (11*50000 lookups against ~10k keys in db with 55k hit rate) on macbook pro 2.6Gh i5 shows improvement from 20 seconds to 10 seconds.