Skip to content

Instantly share code, notes, and snippets.

@frsyuki
Created October 3, 2011 10:27
Show Gist options
  • Save frsyuki/1258840 to your computer and use it in GitHub Desktop.
Save frsyuki/1258840 to your computer and use it in GitHub Desktop.
a = /\Aforward(?![^\.]).*\Z/
b = /\Aforward[^\.].*\Z/
n = 1000000
require 'benchmark'
Benchmark.bm {|x|
x.report("a") do
n.times do
a =~ "forward.test"
end
end
x.report("b") do
n.times do
b =~ "forward.test"
end
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment