bench/string/match.rb
require 'benchmark/ips'require 'ramda' str = 'Tests a regular expression against a String'xs = [/test/, /a/, /something/, /S/, /abc/] Similar blocks of code found in 2 locations. Consider refactoring.Benchmark.ips do |x| x.report('String#match') { str[xs.sample] } x.report('Ramda.match') { Ramda.match(xs.sample, str) } x.report('C Ramda.match') { Ramda.match(xs.sample).call(str) } x.report('CA Ramda.match') { Ramda.match.call(xs.sample).call(str) } x.compare!end