This project is archived and is in readonly mode.

Changeset [1446b686d12ea78d7af93ed1ae88b482435088f8] by Yehuda Katz

August 10th, 2009 @ 11:55 PM

Got overhead down from 127 to 85. All tests pass:

  • Tentatively replaced HeaderHash with SimpleHeaderHash, which does not preserve case but does handle converting Arrays to Strings in to_hash. This requires further discussion.
  • Moved default_charset to ActionDispatch::Response to avoid having to hop over to ActionController. Ideally, this would be a constant on AD::Response, but some tests expect to be able to change it dynamically and I didn't want to change them yet.
  • Completely override #initialize from Rack::Response. Previously, it was creating a HeaderHash, and then we were creating an entirely new one. There is no way to call super without incurring the overhead of creating a HeaderHash.
  • Override #write from Rack::Response. Its implementation tracks Content-Length, and doing so adds additional overhead that could be mooted if other middleware changes the body. It is more efficiently done at the top-level server.
  • Change sending_file to an instance_variable instead of header inspection. In general, if a state is important, it should be set as a property of the response not reconstructed later.
  • Set the Etag to @body instead of .body. AS::Cache.expand_cache_key handles Arrays fine, and it's more efficient to let it handle the body parts, since it is not forced to create a joined String.
  • If we detect the default cache control case, just set it, rather than setting the constituent parts and then running the normal (expensive) code to generate the string. http://github.com/rails/rails/co...

Committed by Yehuda Katz

  • M actionpack/lib/action_controller/metal/compatibility.rb
  • M actionpack/lib/action_controller/metal/streaming.rb
  • M actionpack/lib/action_controller/testing/process.rb
  • M actionpack/lib/action_dispatch/http/response.rb
  • M activesupport/lib/active_support/core_ext/class/attribute_accessors.rb

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>