Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
require "benchmark"
require "benchmark/ips"
require "dish"
hash = {
title: "My Title",
authors: [
{ id: 1, name: "Mike Anderson" },
{ id: 2, name: "Well D." }
],
active: false
}
dish = Dish(hash)
Benchmark.ips do |x|
x.report("hash") { hash[:title] }
x.report("dish") { dish.title }
end
$ ruby dish.rb
Calculating -------------------------------------
hash 69367 i/100ms
dish 24472 i/100ms
-------------------------------------------------
hash 3948215.8 (±23.7%) i/s - 16023777 in 4.999657s
dish 538116.3 (±12.0%) i/s - 2642976 in 5.006639s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.