Created
June 13, 2011 04:16
-
-
Save deepthawtz/1022311 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 "rubygems" | |
require "benchmark" | |
require "rinku" | |
require "action_view" | |
require "erb" | |
include ActionView::Helpers::TextHelper | |
include ActionView::Helpers::TagHelper | |
include ERB::Util | |
N = 300_000 | |
Benchmark.bmbm do |x| | |
x.report("auto_link") do | |
N.times do | |
auto_link(%q{ | |
and stuff and things and all that and http://foo.com/sdf/sdfds/sdfs/ | |
and this and that and https://hello.com/there/ and | |
yes whatever this that http://hi.com/yeah/yeah/yeah/yeah/yeah/yeah/ | |
}, :all) | |
end | |
end | |
x.report("rinku ") do | |
N.times do | |
Rinku.auto_link(%q{ | |
and stuff and things and all that and http://foo.com/sdf/sdfds/sdfs/ | |
and this and that and https://hello.com/there/ and | |
yes whatever this that http://hi.com/yeah/yeah/yeah/yeah/yeah/yeah/ | |
}, :all) | |
end | |
end | |
end | |
__END__ | |
Rehearsal --------------------------------------------- | |
auto_link 43.120000 0.310000 43.430000 ( 43.429595) | |
rinku 1.310000 0.030000 1.340000 ( 1.342187) | |
----------------------------------- total: 44.770000sec | |
user system total real | |
auto_link 43.240000 0.300000 43.540000 ( 43.546075) | |
rinku 1.280000 0.030000 1.310000 ( 1.317649) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment