Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Tie Hash

by bellaire (Hermit)
on Nov 30, 2009 at 16:02 UTC ( #810211=note: print w/replies, xml ) Need Help??


in reply to Tie Hash

I'm not sure I understand your objection to pre-loading the databases. If you want to improve on startup time over in-memory hashes, then you're going to have to have the data somewhere else first, which means you have to pre-load the data.

If you aren't doing that, then you are populating your data to memory first before it gets put into your hashes, and you aren't getting an initial startup time benefit. That's okay, since you'll get the benefit on subsequent uses, but there's also no reason you couldn't implement such a solution using e.g. Tie::DBI rather than pre-loading the data. After all, a tied hash that you couldn't add to wouldn't be very useful.

In short, it seems all of your options are interchangable depending on how you implement them. The difference is in how you want to write your implementation.

Replies are listed 'Best First'.
Re^2: Tie Hash
by BioLion (Curate) on Nov 30, 2009 at 16:23 UTC

    Sorry - maybe i didn't make that clear - Tie::DBI, ties your datastructure to a pre-existing database, i.e. you need to make that database first, then populate from your data. DBM::Deep you can just write and it will do all the creation for you. Once the *populated* database is created, I won't re-create it, for the reasons you pointed out!

    As I said I am trying to learn more about databases, so if i am wrong, please correct me!

    Just a something something...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2019-10-18 09:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?