From: Roger Pack Date: 2008-09-03T14:31:14+09:00 Subject: Hash optimization question Are there any libraries that overcome this problem: (slow example) >> Benchmark.measure { a = {:abc => :def}; 100_000.times { a.each{}}} => #<... @real=0.113940954208374, @utime=0.0999999999999999, @cstime=0.0> (fast example) >> Benchmark.measure { a = {:abc => :def}.to_a; 100_000.times { a.each{}}} => #<...@real=0.0591599941253662, @utime=0.0600000000000001, @cstime=0.0> I.e. they optimize hashes such that their .each_xxx functions work as fast as arrays? My gut instinct is that this is a problem that could be overcome with some hacking in the core, but thought I'd ask. -=R -- Posted via http://www.ruby-forum.com/.