Take a look at this and the thread it is a part of for the best explaination (thanks Merlyn) of this problem that I found.
Note: If you typed "autovivication" into the search box this is what you would have found!
| [reply] |
Here's an alternative: instead of importing the whole thing into memory, use MLDBM. It will require only minimal changes in your code, and should save buckets of RAM.
It's very hard to avoid modifying Perl data structures (and thus unsharing them). Just reading a numeric scalar in a string context causes a change in the memory structure for that scalar. You may not be able to fix it. | [reply] |
in my first version, i used mysql and even with optimized indices the generation took several minutes. thats the cause i put the structure into mem, now it gets the thing done in 5 seconds.
| [reply] |
MLDBM is not MySQL. Try it.
| [reply] |