Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Wrong to use a huge dictionary?

Wrong to use a huge dictionary?
Thread Tools
galarneau
Senior User
Join Date: Sep 2002
Location: Canastota, New York
Status: Offline
Reply With Quote
Jun 7, 2003, 10:54 AM
 
I'm working on an app that stores all of it's data in a dictionary, and writes it to disk for permanent storage.

I wrote a test scenario that made a test dictionary with 50,000 items, and then wrote it to disk. I then made another app to read it back into memory.

The question is: Is this bad form? What is the appropriate way to store a large amount of data on disk and have it available for random access?

To get an idea of what this app does, it is a training log for triathlon training, and each entry into the log is an item in my dictionary.

Thanks for the feedback.
     
Catfish_Man
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
Jun 7, 2003, 12:50 PM
 
Well, iirc, a hashtable is O(n) unless it has a lot of collisions, so adding more elements shouldn't increase the access time. It'll take up a lot of memory if it's that big, but I can't see it taking up more than storing it in a different way.
     
IamBob
Senior User
Join Date: Nov 2000
Status: Offline
Reply With Quote
Jun 7, 2003, 01:08 PM
 
You might just try breaking the dictionary into smaller chunks...

If every month, week or day was stored in its own dictionary you could keep from saving, loading and dealing with a single huge one.

The archiving docs might be worth reading too.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 12:33 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,