fork download
  1. require 'benchmark'
  2. Benchmark.bmbm do |x|
  3. x.report { 500000.times { a = 'foobar'[/(\Afoo)bar/] } }
  4. x.report { 500000.times { a = 'foobar'[/\A(foo)bar/] } }
  5. end
  6.  
Success #stdin #stdout 2.56s 10048KB
stdin
Standard input is empty
stdout
Rehearsal ------------------------------------
   0.630000   0.000000   0.630000 (  0.628344)
   0.620000   0.000000   0.620000 (  0.628949)
--------------------------- total: 1.250000sec

       user     system      total        real
   0.640000   0.000000   0.640000 (  0.635875)
   0.630000   0.000000   0.630000 (  0.627771)