Sha256: 020a46082eeeb55e69342a9f4753473b9ac822a073a7c7ec5b8ee804a2058fb3

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require 'fuzzy_realty.rb'

puts "Benchmarking search through 100,000-1 (powers of ten) random listings"
puts "======================================================================="
listings = []
100_000.times { listings << FuzzyRealty::Listing.random }
puts "Generated #{listings.count} random listings"
Benchmark.bm do |x|
  x.report("100,000 listings:") { FuzzyRealty::ExpertSystem.scores(listings,Query.random) }
  listings = listings[(0...10_000)]
  x.report("10,000 listings:") { FuzzyRealty::ExpertSystem.scores(listings,Query.random) }
  listings = listings[(0...1_000)]
  x.report("1,000 listings:") { FuzzyRealty::ExpertSystem.scores(listings,Query.random) }
  listings = listings[(0...100)]
  x.report("100 listings:") { FuzzyRealty::ExpertSystem.scores(listings,Query.random) }
  listings = listings[(0...10)]
  x.report("10 listings:") { FuzzyRealty::ExpertSystem.scores(listings,Query.random) }
  listings = listings[(0...1)]
  x.report("1 listing:") { FuzzyRealty::ExpertSystem.scores(listings,Query.random) }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rkneufeld-fuzzy-realty-0.7.0 lib/benchmark.rb