Created
December 17, 2011 17:22
-
-
Save j-manu/1490801 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
GC.disable | |
class A | |
def h | |
#ApplicationController.helpers.hidden_field_tag('s', 1, :class => 1) | |
ApplicationController.helpers.text_field_tag('s', 1, :class => 1) | |
end | |
def t | |
ApplicationController.helpers.text_field_tag('s2', 11, :class => 2) | |
end | |
def s | |
'<input type="hidden">' | |
end | |
end | |
a = A.new | |
time = Benchmark.measure do | |
1000.times do |i| | |
a.h | |
end | |
end | |
puts time | |
puts "*********" | |
time = Benchmark.measure do | |
1000.times do |i| | |
a.t | |
end | |
end | |
puts time | |
puts "*********" | |
time = Benchmark.measure do | |
1000.times do |i| | |
a.s | |
end | |
end | |
puts time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment