From: "Iñaki Baz Castillo" Date: 2011-01-13T21:55:43+09:00 Subject: Re: Why {} is much faster than Hash.new ? 2011/1/13 Jonas Pfenniger (zimbatm) : > I think it's the cost of the method call with options parsing. > > Benchmark.realtime do 1_000_000.times do @m = Hash.new end end >  => 1.1976041793823242 > > def blank_method; end > Benchmark.realtime do 1_000_000.times do @m = blank_method end end >  => 0.1965808868408203 > > Benchmark.realtime do 1_000_000.times do @m = {} end end >  => 0.2893531322479248 > > Benchmark.realtime do 1_000_000.times do @m = Hash.allocate end end >  => 0.3925323486328125 > > You see that Hash.allocate's time is about the same as ({} + > blank_method). The rest comes from option parsing I guess. Good point :) Thanks a lot. -- Iñaki Baz Castillo