Re: how to get rid of BTreeContainer as global variable
Jason Madden <[email protected]>
| Newsgroups | gmane.comp.web.zope.zodb |
|---|---|
| Message-ID | <[email protected]> |
> On Sep 7, 2016, at 07:38, Sanjay Rao <[email protected]> wrote: > > I am not using any connection. You may not mean to, but at some point, the `VariantsRegistry` object was in fact persisted to the database. Otherwise this wouldn't be happening. If it wasn't done explicitly, that must mean that it is reachable from some *other* object that was persisted to the database. > I just want a store to have large mapping in RAM. I chose BTreeContainer. I want to replace it with some non-persistent alternative class. You can always use just a normal `dict`. If your keys are well distributed from a hash perspective, you will probably find that the `dict` performs better than a BTree---hashtables have O(1) lookups, but BTrees are O(log n). However, you still need to find out why this object got persisted to the database and stop that from happening. Otherwise, you'll wind up persisting a large `dict`, possibly many times. That's not a good thing. -- You received this message because you are subscribed to the Google Groups "zodb" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.