From: ara.t.howard@... Date: 2006-10-19T07:01:46+09:00 Subject: Re: Performance of ruby hashes On Thu, 19 Oct 2006, Tomasz Wegrzanowski wrote: > On 10/18/06, ara.t.howard@noaa.gov wrote: >> On Wed, 18 Oct 2006, Tomasz Wegrzanowski wrote: >> > On 10/18/06, unni.tallman wrote: >> > Indexing them by symbols instead of strings helps a bit. >> > But hashes are so fast that it's hard to even make a meaningful >> > benchmark. For example in the following meaningless benchmark >> > symbol-hashes are faster than string-hashes: >> >> bad idea for big hashes - symbols are never gc'd and swapping is never >> fast! > > It would have to be totally extreme for that to become a problem, > like with millions different keys in your program. Then you're > absolutely correct, it can seriously hurt. more like hundreds of thousands on a 4gb box: i've notice a few times with big directory indexes, but yes - it must be large. that being said, a web app which dynamically generates symbol keys and which runs for long periods 'leaks'. -a -- my religion is very simple. my religion is kindness. -- the dalai lama