Skip to content

Instantly share code, notes, and snippets.

@biow0lf
Created September 9, 2015 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biow0lf/e4cd0082899c2d83f3fe to your computer and use it in GitHub Desktop.
Save biow0lf/e4cd0082899c2d83f3fe to your computer and use it in GitHub Desktop.
require 'benchmark'
PATH_INFO = '/assets/'
iterations = 100_000_000
Benchmark.bm do |bm|
bm.report do
iterations.times do
PATH_INFO =~ /^\/assets\//
end
end
bm.report do
iterations.times do
PATH_INFO.start_with?('/assets/')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment