Skip to content

Instantly share code, notes, and snippets.

@jlecour
Created February 8, 2012 14:37
Show Gist options
  • Save jlecour/1770127 to your computer and use it in GitHub Desktop.
Save jlecour/1770127 to your computer and use it in GitHub Desktop.
Stress test for Amatch
require 'faker'
require 'amatch'
include Amatch
puts "Start"
str_ref = Faker::Address.city
1_000_000.times do |i|
str_comp = Faker::Address.city
str_ref.pair_distance_similar(str_comp)
str_ref.jarowinkler_similar(str_comp)
str_ref.levenshtein_similar(str_comp)
str_ref.longest_subsequence_similar(str_comp)
str_ref.longest_substring_similar(str_comp)
if i % 1_000 == 0
print '.'
STDOUT.flush
end
end
puts ""
puts "Done !"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment