> You probably need to execute each variant in a loop multiple times to
> get meaningful results.
> 
> Kind regards
> 
>   robert

Thanks robert here are the results ran 100000 times for each approach

require 'benchmark'

iterations = 100000
 Benchmark.bm  do |bm|

  bm.report("Brian:") do

iterations.times do
  expand_seq "t[ac][tc]aaattaag[ga]gaag[ac]ttggtgga" do |seq|
#  puts seq
end
end
  end

bm.report("Jesus:") do
  iterations.times do
  /t[ac][tc]aaattaag[ga]gaag[ac]ttggtgga/.generate
 end
end
 end

 user   system        total     real
Brian: 36.500000   2.080000  38.580000 ( 38.738666)
Jesus: 217.180000   30.710000 247.890000 (248.848401)



-- 
Posted via http://www.ruby-forum.com/.