Skip to content

Instantly share code, notes, and snippets.

@j-manu
Created December 17, 2011 17:22
Show Gist options
  • Save j-manu/1490801 to your computer and use it in GitHub Desktop.
Save j-manu/1490801 to your computer and use it in GitHub Desktop.
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