[Tutor] Filesystem vs Database vs Lucene
John Fouhy
john at fouhy.net
Thu Mar 29 05:04:36 CEST 2007
On 29/03/07, Shitiz Bansal <shitizb at yahoo.com> wrote:
> Shelves seem nice but I would like to be sure on how it is implemented.
> Would it
> seek to a particular point in file and load just the desired data in memory
> or does it unpickle everything and create a fullblown dictionary in
> memory?...in which case the memory problem will resurface.
One great thing about python is that you have the source code, so you
can go check out shelve.py in your python distribution.
If you do that, you will learn that shelve is basically a dictionary
interface over the top of anydbm, python's dbm-style database
interface.
> It might be blasphemous to say this here but is there an equivalent c
> library as I am willing to spend an extra amount of time coding for that
> extra zing in performance.
Many parts of the standard library are written in C, and if you know
what you're doing, you can write your own python modules in C and
incorporate them into your python programs.
--
John.
More information about the Tutor
mailing list