On Sat, Jan 10, 2009 at 07:41:22PM -0500, Jonathan Yu wrote:
> On Fri, Jan 9, 2009 at 12:57 PM, nadim khemir <[email protected]> wrote:
> > 3/ don not put all your data in the module. Although this module is very
> > specific and unlikely to be loaded with a lot of other modules at the same
> > time, it is good to conserve memory. Split your data and load it 
> > dynamically,
> > compress the data if possible.
> How would you suggest doing this? Do you think using SQLite as a
> backing store would be a good idea, or perhaps the Berkeley DB?

If you put the data in a __DATA__ segment, it only gets loaded into
memory when accessed.  My own experience with Number::Phone::UK::Data -
which has a very big database in __DATA__ is that DBM::Deep is very
frugal with memory - as the data is indexed, it is quite happy to seek
back and forth on the DATA filehandle and only load from disk those bits
that are needed.

-- 
David Cantrell | Official London Perl Mongers Bad Influence

    Suffer the little children to come unto me, as
    their buying habits are most easily influenced.
       -- Marketroid Jesus

Reply via email to