benchmark/native.rb in jaro_winkler-1.2.0 vs benchmark/native.rb in jaro_winkler-1.2.1
- old
+ new
@@ -3,23 +3,18 @@
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 '#c_distance(s1, s2)' do
+ x.report 'jaro_winkler' do
n.times{ ary.each{ |str1, str2| JaroWinkler.c_distance(str1, str2) } }
end
- x.report '#distance(s1, s2, native: true)' do
- n.times{ ary.each{ |str1, str2| JaroWinkler.distance(str1, str2, native: true) } }
- 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
-# #c_distance(s1, s2) 0.350000 0.000000 0.350000 ( 0.349109)
-# #distance(s1, s2, native: true) 2.480000 0.050000 2.530000 ( 2.526027)
-# fuzzystringmatch 0.160000 0.000000 0.160000 ( 0.155539)
+# user system total real
+# jaro_winkler 0.380000 0.000000 0.380000 ( 0.386071)
+# fuzzystringmatch 0.140000 0.000000 0.140000 ( 0.138053)
\ No newline at end of file