Created
October 11, 2012 18:34
-
-
Save vlada79/3874585 to your computer and use it in GitHub Desktop.
Mash vs Hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require 'hashie' | |
rep = 10_000_000 | |
Benchmark.bm 20 do |x| | |
x.report 'Hashie(Mash)' do | |
rep.times do |index| | |
Hashie::Mash.new({ :name => "User", :age => 21 }) | |
end | |
end | |
x.report 'Hash' do | |
rep.times do |index| | |
{ :name => "User", :age => 21 } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment