Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Efficient ways of storing a data set for random access

by l3nz (Friar)
on Jan 29, 2004 at 12:35 UTC ( #324921=note: print w/replies, xml ) Need Help??


in reply to Efficient ways of storing a data set for random access

Your approach is not bad at all; you are trading memory versus a much higher access speed than the actual generation might require. The use of a data file allows for simple tweaking of the data distribuition just by altering the number of elements in the file.

I'd extend it by randomizing based on the actual number of item read from file, and I'd load the file at startup without touching it anymore; this way your program will be fast.

Or of course you could use one of the statistical modules...

  • Comment on Re: Efficient ways of storing a data set for random access

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://324921]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2023-03-30 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (74 votes). Check out past polls.

    Notices?