Sha256: 8f3a4b9e769f01cfd9b237145a99a343e95aa1f977677747e6126f8812ad038f

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

require 'fuzzy_realty.rb'
if __FILE__ == $0
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
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rkneufeld-fuzzy-realty-0.7.1 lib/benchmark.rb
rkneufeld-fuzzy-realty-0.7.2 lib/benchmark.rb
rkneufeld-fuzzy-realty-0.7.3 lib/benchmark.rb