Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: b31c30ada8
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (22 sloc) 0.451 kb
# encoding: utf-8
require 'rubygems'
require 'benchmark'
#require 'unprof'
require './lib/textquery.rb'
queries = []
queries << TextQuery.new("イケア OR イケヤ")
queries << TextQuery.new("obama 'health care' michel OR obama -tax")
text = ""
File.open('benchmark/sample.txt').each_line{ |s|
text << s
}
n = 10000
Benchmark.bm do |x|
x.report do
n.times do
queries.each do |q|
q.match?(text)
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.