This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
iterations = 1_000_000 | |
words = 'foo, bar, test, boo'.split(',').map(&:strip) | |
string = 'this is going foo be awesome~!' | |
Benchmark.bmbm do |bm| | |
bm.report do | |
iterations.times do | |
words.any? { |s| string.include?(s) } | |
end |
NewerOlder