Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Efficient memory

by jlongino (Parson)
on Nov 05, 2002 at 16:56 UTC ( #210511=note: print w/replies, xml ) Need Help??

in reply to Efficient memory

I agree with rdfield and think that it would be worthwhile to give Storable a try. Why? because it is simple, faster than MLDBM, and you could probably write/test throwaway scripts in less than 15 minutes:
use strict; use warnings; use Storable qw(nstore); my %data; ## sub that loads hash GetData('data.txt', \%data); ## store to disk nstore (\%data, "data.nstore");
To retrieve:
use strict; use warnings; use Storable qw(retrieve); my %data = %{ retrieve("data.nstore") };
I use storable on data structures of the form data{a}{b}{c} for employee records. The flat text file is 1.5MB (5000 records), the nstored version is 3.5MB and it takes less than 2 seconds to store or retrieve. Try it and decide for yourself.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://210511]
[LanX]: I don't get it
[LanX]: do I need to activate JS to see Trump loosing his wig?
[LanX]: aha ...
LanX Finally, there is a certain order or choreography to the greetings, which Kornhauser-Duda appears to have been following. First, the two heads of state shake hands, while the two first ladies do the same
[LanX]: FAKE NEWS , erix, so sad! Fired!

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2018-03-22 20:11 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (285 votes). Check out past polls.