This project is archived and is in readonly mode.
Avoid potentially expensive inspect call in router
Reported by Samuel Lebeau | April 27th, 2010 @ 10:24 PM
The attached patch defers the creation of a routing error
message in
ActionDispatch::Routing::RouteSet::Generator#generate
which invoke inspect
on the argument of
url_for
(or any routing helper method actually).
This call might be expensive, especially when the argument happens to be a database record with blob fields, and is currently executed even if the route is valid.
For example, when using SlimScrooge with the
following view:
<%= link_to foo.name, foo %>
SELECT
ed fields are expected to be id
and
name
, but happen to be all fields from the table.
The patch applies on HEAD and fixes the above-mentioned issue, all tests are passing.
Comments and changes to this ticket
-
Samuel Lebeau August 3rd, 2010 @ 06:43 AM
- Assigned user set to José Valim
-
José Valim August 3rd, 2010 @ 09:49 AM
- Importance changed from to Low
Sorry, the patch no longer applies. Could you please rebase?
-
Repository August 3rd, 2010 @ 11:03 AM
- State changed from new to resolved
(from [f01184ad9e7efbbcdb8581c93b92e16c61c7a6bd]) Avoid potentially expensive inspect call in router. [#4491 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/f01184ad9e7efbbcdb8581c93b92e1... -
Repository August 3rd, 2010 @ 11:04 AM
(from [a44779e9bb2b4af0ce6d0e77746e751c9b10d823]) Avoid potentially expensive inspect call in router. [#4491 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/a44779e9bb2b4af0ce6d0e77746e75...
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>
People watching this ticket
Attachments
Tags
Referenced by
- 4491 Avoid potentially expensive inspect call in router (from [f01184ad9e7efbbcdb8581c93b92e16c61c7a6bd]) Avoid p...
- 4491 Avoid potentially expensive inspect call in router (from [a44779e9bb2b4af0ce6d0e77746e751c9b10d823]) Avoid p...