require 'benchmark' require 'jaro_winkler' require 'fuzzystringmatch' ary = [['al', 'al'], ['martha', 'marhta'], ['jones', 'johnson'], ['abcvwxyz', 'cabvwxyz'], ['dwayne', 'duane'], ['dixon', 'dicksonx'], ['fvie', 'ten']] n = 100000 Benchmark.bmbm do |x| x.report 'jaro_winkler' do n.times{ ary.each{ |str1, str2| JaroWinkler.c_distance(str1, str2) } } end x.report 'fuzzystringmatch' do jarow = FuzzyStringMatch::JaroWinkler.create(:native) n.times{ ary.each{ |str1, str2| jarow.getDistance(str1, str2) } } end end # user system total real # jaro_winkler 0.380000 0.000000 0.380000 ( 0.386071) # fuzzystringmatch 0.140000 0.000000 0.140000 ( 0.138053)