1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

This change causes some failing tests, but it should be possible to make them pass with minimal performance impact.

This commit is contained in:
Yehuda Katz 2009-08-09 07:14:24 -03:00
parent 0a558b36eb
commit 04d4537cd4
3 changed files with 20 additions and 15 deletions

View file

@ -91,6 +91,8 @@ class HttpPostController < ActionController::Metal
end
end
ActionController::Base.use_accept_header = false
unless ENV["PROFILE"]
Runner.run(BasePostController.action(:overhead), N, 'overhead', false)
Runner.run(BasePostController.action(:index), N, 'index', false)
@ -108,10 +110,10 @@ unless ENV["PROFILE"]
Runner.run(BasePostController.action(:show_template), N, 'template')
end
else
Runner.run(BasePostController.action(:many_partials), N, 'many_partials')
Runner.run(BasePostController.action(ENV["PROFILE"].to_sym), N, ENV["PROFILE"])
require "ruby-prof"
RubyProf.start
Runner.run(BasePostController.action(:many_partials), N, 'many_partials')
Runner.run(BasePostController.action(ENV["PROFILE"].to_sym), N, ENV["PROFILE"])
result = RubyProf.stop
printer = RubyProf::CallStackPrinter.new(result)
printer.print(File.open("output.html", "w"))

View file

@ -176,17 +176,18 @@ module ActionDispatch
# Expand raw_formats by converting Mime::ALL to the Mime::SET.
#
def formats
if ActionController::Base.use_accept_header
raw_formats.tap do |ret|
if ret == ONLY_ALL
ret.replace Mime::SET
elsif all = ret.index(Mime::ALL)
ret.delete_at(all) && ret.insert(all, *Mime::SET)
end
end
else
raw_formats + Mime::SET
end
return raw_formats
# if ActionController::Base.use_accept_header
# raw_formats.tap do |ret|
# if ret == ONLY_ALL
# ret.replace Mime::SET
# elsif all = ret.index(Mime::ALL)
# ret.delete_at(all) && ret.insert(all, *Mime::SET)
# end
# end
# else
# raw_formats + Mime::SET
# end
end
# Sets the \format by string extension, which can be used to force custom formats

View file

@ -41,9 +41,11 @@ module ActionView
end
def handler_glob
@handler_glob ||= begin
e = TemplateHandlers.extensions.map{|h| ".#{h},"}.join
"{#{e}}"
end
end
def formats_glob
@formats_glob ||= begin