File: mash_method_access.rb

package info (click to toggle)
ruby-hashie 5.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 884 kB
  • sloc: ruby: 7,049; sh: 8; makefile: 6
file content (15 lines) | stat: -rwxr-xr-x 255 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$LOAD_PATH.unshift('lib')

require 'hashie'
require 'benchmark/ips'

mash = Hashie::Mash.new(test: 'value')

Benchmark.ips do |x|
  x.hold!('tmp/mash_benchmark.json')

  x.report('before') { mash.test }
  x.report('after') { mash.test }

  x.compare!
end