From: SpringFlowers AutumnMoon Date: 2007-09-19T01:04:06+09:00 Subject: Re: how to use tuple as hash key Rick Denatale wrote: > On 9/18/07, SpringFlowers AutumnMoon wrote: > You seem to be worried about the memory requirements for storing the > keys. I'm not sure there's much that can be done about that though, > If you want to have a hash with 10,000 entries, then all 10,000 keys > are going to have to be unique and will have to be stored. fortunately, if the loop "dup" the key 100 million times, but the hash only has 10,000 unique key values, then only 10,000 objects will exist. the other "dup" keys will be garbage collected. (and quickly too, as the memory usage never went up to 4 or 5 MB). -- Posted via http://www.ruby-forum.com/.