yangtse has asked for the wisdom of the Perl Monks concerning the following question:

Hi folks,

I am considering if I need to us MLDBM to store and retrieve my data. My data size can be over 20M. My question is the performance of this module. I have been used the Storable.pm, and feel it is slow because I have to load the whole data structure each time when I need to modify it even for one single record. That is why I consider to use MLDBM.pm. Just not sure if it will fit my needs that I need to edit big data on the fly and want to have a reasonable performance.

Any suggestions? Thanks in advance!

  • Comment on MLDBM - store multi-level hash structure in single level tied hash

Replies are listed 'Best First'.
Re: MLDBM - store multi-level hash structure in single level tied hash
by perrin (Chancellor) on Aug 26, 2002 at 15:05 UTC
    If your data structure is wide and not too deep (many keys in the top-level hash with small structures under each, as opposed to a few keys in the top-level hash with huge structures under each), MLDBM will work great. However, 20MB isn't much data even with just Storable. Are you sure it's slow? Have you timed it? It may not be worth changing.
      It takes 2-3 seconds to retrieve and store data when using Storable. Isn't it slow? Thanks.
        That is very slow. Maybe your filesystem is on the slow side, or maybe your data structure is unusually complex. At any rate, MLDBM helps with this problem in most situations.