in reply to Immense hashes
Your sample code isn't very convincing. Why would you be setting all the elements of your hash to a value of 'blah'?
Also, 200ish elements in a hash is not even close to immense. In fact it's tiny. Creating hashes of 100s of 1000s of keys is routine if you have enough memory. I just ran the following code which creates a hash with 100_000 keys read from a file and extracted using a regex and it took around 2 seconds to run.
open I, '<', 'data/junk'; m[^(\d+)$] and $h{$1} = undef while <I>; print scalar keys %h; 100000
Essentially, if you are experiencing long delays in creating your hash of 200 keys, then there is some cause that is not identified in your code. Posting the actual code that is giving the problem (or a salient subset of it) is likely to get a much better answer.
|
|---|