Created
September 9, 2015 13:30
-
-
Save biow0lf/e4cd0082899c2d83f3fe to your computer and use it in GitHub Desktop.
This file contains 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' | |
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