Quoth da...@cantrell.org.uk (David Cantrell):
> On Sat, Jan 10, 2009 at 07:41:22PM -0500, Jonathan Yu wrote:
> > On Fri, Jan 9, 2009 at 12:57 PM, nadim khemir <na...@khemir.net> 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.

If you're going to do that (and it's a good idea), surely it would be
better to put the data in a real file and use File::ShareDir or some
such to find it?

Ben

Reply via email to