Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'benchmark/ips'
- SYM = :magic_key
- MYS = :key_magic
- STR = 'magic_key'
- RTS = 'key_magic'
- Benchmark.ips do |x|
- x.config(time: 2, warmup: 1)
- x.report('Symbol#==') do
- SYM == SYM
- end
- x.report('Symbol#!=') do
- SYM == MYS
- end
- x.report('String#==') do
- STR == STR
- end
- x.report('String#!=') do
- STR == RTS
- end
- x.compare!
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement