Skip to content

Commit

Permalink
fix benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
tonytonyjan committed Dec 12, 2015
1 parent 8fd870e commit 72e64ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion benchmark/native.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
n = 100000
Benchmark.bmbm do |x|
x.report "jaro_winkler #{Gem.loaded_specs['jaro_winkler'].version}" do
n.times{ ary.each{ |str1, str2| JaroWinkler.c_distance(str1, str2) } }
n.times{ ary.each{ |str1, str2| JaroWinkler.distance(str1, str2) } }
end

x.report "fuzzystringmatch #{Gem.loaded_specs['fuzzy-string-match'].version}" do
Expand Down
4 changes: 2 additions & 2 deletions benchmark/pure.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
require 'jaro_winkler/jaro_winkler_pure'
require 'benchmark'
require 'jaro_winkler'
require 'fuzzystringmatch'
ary = [['al', 'al'], ['martha', 'marhta'], ['jones', 'johnson'], ['abcvwxyz', 'cabvwxyz'], ['dwayne', 'duane'], ['dixon', 'dicksonx'], ['fvie', 'ten']]

n = 10000
Benchmark.bmbm do |x|
x.report "jaro_winkler #{Gem.loaded_specs['jaro_winkler'].version}" do
n.times{ ary.each{ |str1, str2| JaroWinkler.r_distance(str1, str2) } }
n.times{ ary.each{ |str1, str2| JaroWinkler.distance(str1, str2) } }
end

x.report "fuzzystringmatch #{Gem.loaded_specs['fuzzy-string-match'].version}" do
Expand Down

0 comments on commit 72e64ca

Please sign in to comment.